diff options
author | reveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-25 17:48:07 +0000 |
---|---|---|
committer | reveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-25 17:48:07 +0000 |
commit | 9dcd07a68e2e2208ac6455b37a6c1f760653b7e6 (patch) | |
tree | b71491414cb0fae068435cf15058945319930a70 | |
parent | a4ed76ec4efb2ea4e447b3ae3e70cf940cb8f333 (diff) | |
download | chromium_src-9dcd07a68e2e2208ac6455b37a6c1f760653b7e6.zip chromium_src-9dcd07a68e2e2208ac6455b37a6c1f760653b7e6.tar.gz chromium_src-9dcd07a68e2e2208ac6455b37a6c1f760653b7e6.tar.bz2 |
cc: Rename CanvasLayerUpdater to ContentLayerUpdater.
sed -e '
s/CanvasLayerUpdater/ContentLayerUpdater/g
s/canvas_layer_updater/content_layer_updater/g
'
BUG=
TEST=cc_unittests
Review URL: https://codereview.chromium.org/11271022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164104 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | cc/bitmap_content_layer_updater.cc (renamed from cc/bitmap_canvas_layer_updater.cc) | 26 | ||||
-rw-r--r-- | cc/bitmap_content_layer_updater.h (renamed from cc/bitmap_canvas_layer_updater.h) | 22 | ||||
-rw-r--r-- | cc/bitmap_skpicture_content_layer_updater.cc (renamed from cc/bitmap_skpicture_canvas_layer_updater.cc) | 22 | ||||
-rw-r--r-- | cc/bitmap_skpicture_content_layer_updater.h (renamed from cc/bitmap_skpicture_canvas_layer_updater.h) | 24 | ||||
-rw-r--r-- | cc/caching_bitmap_content_layer_updater.cc (renamed from cc/caching_bitmap_canvas_layer_updater.cc) | 22 | ||||
-rw-r--r-- | cc/caching_bitmap_content_layer_updater.h (renamed from cc/caching_bitmap_canvas_layer_updater.h) | 12 | ||||
-rw-r--r-- | cc/cc.gyp | 20 | ||||
-rw-r--r-- | cc/content_layer.cc | 10 | ||||
-rw-r--r-- | cc/content_layer_unittest.cc | 4 | ||||
-rw-r--r-- | cc/content_layer_updater.cc (renamed from cc/canvas_layer_updater.cc) | 10 | ||||
-rw-r--r-- | cc/content_layer_updater.h (renamed from cc/canvas_layer_updater.h) | 16 | ||||
-rw-r--r-- | cc/scrollbar_layer.cc | 8 | ||||
-rw-r--r-- | cc/scrollbar_layer.h | 10 | ||||
-rw-r--r-- | cc/skpicture_canvas_layer_updater.cc | 79 | ||||
-rw-r--r-- | cc/skpicture_content_layer_updater.cc | 79 | ||||
-rw-r--r-- | cc/skpicture_content_layer_updater.h (renamed from cc/skpicture_canvas_layer_updater.h) | 26 | ||||
-rw-r--r-- | cc/tiled_layer_unittest.cc | 6 |
17 files changed, 198 insertions, 198 deletions
diff --git a/cc/bitmap_canvas_layer_updater.cc b/cc/bitmap_content_layer_updater.cc index 625d2c7..34e5970 100644 --- a/cc/bitmap_canvas_layer_updater.cc +++ b/cc/bitmap_content_layer_updater.cc @@ -4,7 +4,7 @@ #include "config.h" -#include "cc/bitmap_canvas_layer_updater.h" +#include "cc/bitmap_content_layer_updater.h" #include "cc/layer_painter.h" #include "cc/resource_update.h" @@ -13,42 +13,42 @@ namespace cc { -BitmapCanvasLayerUpdater::Resource::Resource(BitmapCanvasLayerUpdater* updater, scoped_ptr<PrioritizedTexture> texture) +BitmapContentLayerUpdater::Resource::Resource(BitmapContentLayerUpdater* updater, scoped_ptr<PrioritizedTexture> texture) : LayerUpdater::Resource(texture.Pass()) , m_updater(updater) { } -BitmapCanvasLayerUpdater::Resource::~Resource() +BitmapContentLayerUpdater::Resource::~Resource() { } -void BitmapCanvasLayerUpdater::Resource::update(TextureUpdateQueue& queue, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&) +void BitmapContentLayerUpdater::Resource::update(TextureUpdateQueue& queue, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&) { updater()->updateTexture(queue, texture(), sourceRect, destOffset, partialUpdate); } -scoped_refptr<BitmapCanvasLayerUpdater> BitmapCanvasLayerUpdater::create(scoped_ptr<LayerPainter> painter) +scoped_refptr<BitmapContentLayerUpdater> BitmapContentLayerUpdater::create(scoped_ptr<LayerPainter> painter) { - return make_scoped_refptr(new BitmapCanvasLayerUpdater(painter.Pass())); + return make_scoped_refptr(new BitmapContentLayerUpdater(painter.Pass())); } -BitmapCanvasLayerUpdater::BitmapCanvasLayerUpdater(scoped_ptr<LayerPainter> painter) - : CanvasLayerUpdater(painter.Pass()) +BitmapContentLayerUpdater::BitmapContentLayerUpdater(scoped_ptr<LayerPainter> painter) + : ContentLayerUpdater(painter.Pass()) , m_opaque(false) { } -BitmapCanvasLayerUpdater::~BitmapCanvasLayerUpdater() +BitmapContentLayerUpdater::~BitmapContentLayerUpdater() { } -scoped_ptr<LayerUpdater::Resource> BitmapCanvasLayerUpdater::createResource(PrioritizedTextureManager* manager) +scoped_ptr<LayerUpdater::Resource> BitmapContentLayerUpdater::createResource(PrioritizedTextureManager* manager) { return scoped_ptr<LayerUpdater::Resource>(new Resource(this, PrioritizedTexture::create(manager))); } -void BitmapCanvasLayerUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, RenderingStats& stats) +void BitmapContentLayerUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, RenderingStats& stats) { if (m_canvasSize != contentRect.size()) { m_canvasSize = contentRect.size(); @@ -58,7 +58,7 @@ void BitmapCanvasLayerUpdater::prepareToUpdate(const IntRect& contentRect, const paintContents(m_canvas.get(), contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect, stats); } -void BitmapCanvasLayerUpdater::updateTexture(TextureUpdateQueue& queue, PrioritizedTexture* texture, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate) +void BitmapContentLayerUpdater::updateTexture(TextureUpdateQueue& queue, PrioritizedTexture* texture, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate) { ResourceUpdate upload = ResourceUpdate::Create( texture, @@ -72,7 +72,7 @@ void BitmapCanvasLayerUpdater::updateTexture(TextureUpdateQueue& queue, Prioriti queue.appendFullUpload(upload); } -void BitmapCanvasLayerUpdater::setOpaque(bool opaque) +void BitmapContentLayerUpdater::setOpaque(bool opaque) { if (opaque != m_opaque) { m_canvas.reset(); diff --git a/cc/bitmap_canvas_layer_updater.h b/cc/bitmap_content_layer_updater.h index 7e6a17b..573bcac 100644 --- a/cc/bitmap_canvas_layer_updater.h +++ b/cc/bitmap_content_layer_updater.h @@ -3,10 +3,10 @@ // found in the LICENSE file. -#ifndef BitmapCanvasLayerUpdater_h -#define BitmapCanvasLayerUpdater_h +#ifndef BitmapContentLayerUpdater_h +#define BitmapContentLayerUpdater_h -#include "cc/canvas_layer_updater.h" +#include "cc/content_layer_updater.h" class SkCanvas; @@ -17,22 +17,22 @@ class LayerPainter; // This class rasterizes the contentRect into a skia bitmap canvas. It then updates // textures by copying from the canvas into the texture, using MapSubImage if // possible. -class BitmapCanvasLayerUpdater : public CanvasLayerUpdater { +class BitmapContentLayerUpdater : public ContentLayerUpdater { public: class Resource : public LayerUpdater::Resource { public: - Resource(BitmapCanvasLayerUpdater*, scoped_ptr<PrioritizedTexture>); + Resource(BitmapContentLayerUpdater*, scoped_ptr<PrioritizedTexture>); virtual ~Resource(); virtual void update(TextureUpdateQueue&, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE; private: - BitmapCanvasLayerUpdater* updater() { return m_updater; } + BitmapContentLayerUpdater* updater() { return m_updater; } - BitmapCanvasLayerUpdater* m_updater; + BitmapContentLayerUpdater* m_updater; }; - static scoped_refptr<BitmapCanvasLayerUpdater> create(scoped_ptr<LayerPainter>); + static scoped_refptr<BitmapContentLayerUpdater> create(scoped_ptr<LayerPainter>); virtual scoped_ptr<LayerUpdater::Resource> createResource(PrioritizedTextureManager*) OVERRIDE; virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, RenderingStats&) OVERRIDE; @@ -41,8 +41,8 @@ public: virtual void setOpaque(bool) OVERRIDE; protected: - explicit BitmapCanvasLayerUpdater(scoped_ptr<LayerPainter>); - virtual ~BitmapCanvasLayerUpdater(); + explicit BitmapContentLayerUpdater(scoped_ptr<LayerPainter>); + virtual ~BitmapContentLayerUpdater(); scoped_ptr<SkCanvas> m_canvas; IntSize m_canvasSize; @@ -51,4 +51,4 @@ protected: } // namespace cc -#endif // BitmapCanvasLayerUpdater_h +#endif // BitmapContentLayerUpdater_h diff --git a/cc/bitmap_skpicture_canvas_layer_updater.cc b/cc/bitmap_skpicture_content_layer_updater.cc index 7b12e27..cf52a96 100644 --- a/cc/bitmap_skpicture_canvas_layer_updater.cc +++ b/cc/bitmap_skpicture_content_layer_updater.cc @@ -4,7 +4,7 @@ #include "config.h" -#include "cc/bitmap_skpicture_canvas_layer_updater.h" +#include "cc/bitmap_skpicture_content_layer_updater.h" #include "base/time.h" #include "cc/layer_painter.h" @@ -15,13 +15,13 @@ namespace cc { -BitmapSkPictureCanvasLayerUpdater::Resource::Resource(BitmapSkPictureCanvasLayerUpdater* updater, scoped_ptr<PrioritizedTexture> texture) - : CanvasLayerUpdater::Resource(texture.Pass()) +BitmapSkPictureContentLayerUpdater::Resource::Resource(BitmapSkPictureContentLayerUpdater* updater, scoped_ptr<PrioritizedTexture> texture) + : ContentLayerUpdater::Resource(texture.Pass()) , m_updater(updater) { } -void BitmapSkPictureCanvasLayerUpdater::Resource::update(TextureUpdateQueue& queue, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats& stats) +void BitmapSkPictureContentLayerUpdater::Resource::update(TextureUpdateQueue& queue, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats& stats) { m_bitmap.setConfig(SkBitmap::kARGB_8888_Config, sourceRect.width(), sourceRect.height()); m_bitmap.allocPixels(); @@ -40,26 +40,26 @@ void BitmapSkPictureCanvasLayerUpdater::Resource::update(TextureUpdateQueue& que queue.appendFullUpload(upload); } -scoped_refptr<BitmapSkPictureCanvasLayerUpdater> BitmapSkPictureCanvasLayerUpdater::create(scoped_ptr<LayerPainter> painter) +scoped_refptr<BitmapSkPictureContentLayerUpdater> BitmapSkPictureContentLayerUpdater::create(scoped_ptr<LayerPainter> painter) { - return make_scoped_refptr(new BitmapSkPictureCanvasLayerUpdater(painter.Pass())); + return make_scoped_refptr(new BitmapSkPictureContentLayerUpdater(painter.Pass())); } -BitmapSkPictureCanvasLayerUpdater::BitmapSkPictureCanvasLayerUpdater(scoped_ptr<LayerPainter> painter) - : SkPictureCanvasLayerUpdater(painter.Pass()) +BitmapSkPictureContentLayerUpdater::BitmapSkPictureContentLayerUpdater(scoped_ptr<LayerPainter> painter) + : SkPictureContentLayerUpdater(painter.Pass()) { } -BitmapSkPictureCanvasLayerUpdater::~BitmapSkPictureCanvasLayerUpdater() +BitmapSkPictureContentLayerUpdater::~BitmapSkPictureContentLayerUpdater() { } -scoped_ptr<LayerUpdater::Resource> BitmapSkPictureCanvasLayerUpdater::createResource(PrioritizedTextureManager* manager) +scoped_ptr<LayerUpdater::Resource> BitmapSkPictureContentLayerUpdater::createResource(PrioritizedTextureManager* manager) { return scoped_ptr<LayerUpdater::Resource>(new Resource(this, PrioritizedTexture::create(manager))); } -void BitmapSkPictureCanvasLayerUpdater::paintContentsRect(SkCanvas* canvas, const IntRect& sourceRect, RenderingStats& stats) +void BitmapSkPictureContentLayerUpdater::paintContentsRect(SkCanvas* canvas, const IntRect& sourceRect, RenderingStats& stats) { // Translate the origin of contentRect to that of sourceRect. canvas->translate(contentRect().x() - sourceRect.x(), diff --git a/cc/bitmap_skpicture_canvas_layer_updater.h b/cc/bitmap_skpicture_content_layer_updater.h index a00f322..0c76a72 100644 --- a/cc/bitmap_skpicture_canvas_layer_updater.h +++ b/cc/bitmap_skpicture_content_layer_updater.h @@ -2,41 +2,41 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BitmapSkPictureCanvasLayerUpdater_h -#define BitmapSkPictureCanvasLayerUpdater_h +#ifndef BitmapSkPictureContentLayerUpdater_h +#define BitmapSkPictureContentLayerUpdater_h -#include "cc/skpicture_canvas_layer_updater.h" +#include "cc/skpicture_content_layer_updater.h" #include "third_party/skia/include/core/SkBitmap.h" namespace cc { // This class records the contentRect into an SkPicture, then software rasterizes // the SkPicture into bitmaps for each tile. This implements Settings::perTilePainting. -class BitmapSkPictureCanvasLayerUpdater : public SkPictureCanvasLayerUpdater { +class BitmapSkPictureContentLayerUpdater : public SkPictureContentLayerUpdater { public: - class Resource : public CanvasLayerUpdater::Resource { + class Resource : public ContentLayerUpdater::Resource { public: - Resource(BitmapSkPictureCanvasLayerUpdater*, scoped_ptr<PrioritizedTexture>); + Resource(BitmapSkPictureContentLayerUpdater*, scoped_ptr<PrioritizedTexture>); virtual void update(TextureUpdateQueue&, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE; private: - BitmapSkPictureCanvasLayerUpdater* updater() { return m_updater; } + BitmapSkPictureContentLayerUpdater* updater() { return m_updater; } SkBitmap m_bitmap; - BitmapSkPictureCanvasLayerUpdater* m_updater; + BitmapSkPictureContentLayerUpdater* m_updater; }; - static scoped_refptr<BitmapSkPictureCanvasLayerUpdater> create(scoped_ptr<LayerPainter>); + static scoped_refptr<BitmapSkPictureContentLayerUpdater> create(scoped_ptr<LayerPainter>); virtual scoped_ptr<LayerUpdater::Resource> createResource(PrioritizedTextureManager*) OVERRIDE; void paintContentsRect(SkCanvas*, const IntRect& sourceRect, RenderingStats&); private: - explicit BitmapSkPictureCanvasLayerUpdater(scoped_ptr<LayerPainter>); - virtual ~BitmapSkPictureCanvasLayerUpdater(); + explicit BitmapSkPictureContentLayerUpdater(scoped_ptr<LayerPainter>); + virtual ~BitmapSkPictureContentLayerUpdater(); }; } // namespace cc -#endif // BitmapSkPictureCanvasLayerUpdater_h +#endif // BitmapSkPictureContentLayerUpdater_h diff --git a/cc/caching_bitmap_canvas_layer_updater.cc b/cc/caching_bitmap_content_layer_updater.cc index c16af60..3e3d058 100644 --- a/cc/caching_bitmap_canvas_layer_updater.cc +++ b/cc/caching_bitmap_content_layer_updater.cc @@ -4,39 +4,39 @@ #include "config.h" -#include "caching_bitmap_canvas_layer_updater.h" +#include "caching_bitmap_content_layer_updater.h" #include "cc/layer_painter.h" #include "skia/ext/platform_canvas.h" namespace cc { -scoped_refptr<CachingBitmapCanvasLayerUpdater> -CachingBitmapCanvasLayerUpdater::Create( +scoped_refptr<CachingBitmapContentLayerUpdater> +CachingBitmapContentLayerUpdater::Create( scoped_ptr<LayerPainter> painter) { - return make_scoped_refptr(new CachingBitmapCanvasLayerUpdater( + return make_scoped_refptr(new CachingBitmapContentLayerUpdater( painter.Pass())); } -CachingBitmapCanvasLayerUpdater::CachingBitmapCanvasLayerUpdater( +CachingBitmapContentLayerUpdater::CachingBitmapContentLayerUpdater( scoped_ptr<LayerPainter> painter) - : BitmapCanvasLayerUpdater(painter.Pass()), + : BitmapContentLayerUpdater(painter.Pass()), pixels_did_change_(false) { } -CachingBitmapCanvasLayerUpdater:: - ~CachingBitmapCanvasLayerUpdater() +CachingBitmapContentLayerUpdater:: + ~CachingBitmapContentLayerUpdater() { } -void CachingBitmapCanvasLayerUpdater::prepareToUpdate( +void CachingBitmapContentLayerUpdater::prepareToUpdate( const IntRect& content_rect, const IntSize& tile_size, float contents_width_scale, float contents_height_scale, IntRect& resulting_opaque_rect, RenderingStats& stats) { - BitmapCanvasLayerUpdater::prepareToUpdate(content_rect, + BitmapContentLayerUpdater::prepareToUpdate(content_rect, tile_size, contents_width_scale, contents_height_scale, @@ -57,7 +57,7 @@ void CachingBitmapCanvasLayerUpdater::prepareToUpdate( new_bitmap.deepCopyTo(&cached_bitmap_, new_bitmap.config()); } -bool CachingBitmapCanvasLayerUpdater::pixelsDidChange() const +bool CachingBitmapContentLayerUpdater::pixelsDidChange() const { return pixels_did_change_; } diff --git a/cc/caching_bitmap_canvas_layer_updater.h b/cc/caching_bitmap_content_layer_updater.h index bd48683..334a26e 100644 --- a/cc/caching_bitmap_canvas_layer_updater.h +++ b/cc/caching_bitmap_content_layer_updater.h @@ -6,14 +6,14 @@ #define CACHING_BITMAP_CANVAS_LAYER_UPDATER_H_ #include "base/compiler_specific.h" -#include "cc/bitmap_canvas_layer_updater.h" +#include "cc/bitmap_content_layer_updater.h" namespace cc { -class CachingBitmapCanvasLayerUpdater - : public BitmapCanvasLayerUpdater { +class CachingBitmapContentLayerUpdater + : public BitmapContentLayerUpdater { public: - static scoped_refptr<CachingBitmapCanvasLayerUpdater> Create( + static scoped_refptr<CachingBitmapContentLayerUpdater> Create( scoped_ptr<LayerPainter>); virtual void prepareToUpdate(const IntRect& content_rect, @@ -26,9 +26,9 @@ class CachingBitmapCanvasLayerUpdater bool pixelsDidChange() const; private: - explicit CachingBitmapCanvasLayerUpdater( + explicit CachingBitmapContentLayerUpdater( scoped_ptr<LayerPainter> painter); - virtual ~CachingBitmapCanvasLayerUpdater(); + virtual ~CachingBitmapContentLayerUpdater(); bool pixels_did_change_; SkBitmap cached_bitmap_; @@ -9,12 +9,12 @@ 'scoped_ptr_deque.h', 'scoped_ptr_hash_map.h', 'scoped_ptr_vector.h', - 'bitmap_canvas_layer_updater.cc', - 'bitmap_canvas_layer_updater.h', - 'bitmap_skpicture_canvas_layer_updater.cc', - 'bitmap_skpicture_canvas_layer_updater.h', - 'caching_bitmap_canvas_layer_updater.cc', - 'caching_bitmap_canvas_layer_updater.h', + 'bitmap_content_layer_updater.cc', + 'bitmap_content_layer_updater.h', + 'bitmap_skpicture_content_layer_updater.cc', + 'bitmap_skpicture_content_layer_updater.h', + 'caching_bitmap_content_layer_updater.cc', + 'caching_bitmap_content_layer_updater.h', 'active_animation.cc', 'active_animation.h', 'append_quads_data.h', @@ -170,8 +170,8 @@ 'video_layer_impl.h', 'yuv_video_draw_quad.cc', 'yuv_video_draw_quad.h', - 'canvas_layer_updater.cc', - 'canvas_layer_updater.h', + 'content_layer_updater.cc', + 'content_layer_updater.h', 'content_layer.cc', 'content_layer.h', 'content_layer_client.h', @@ -201,8 +201,8 @@ 'scrollbar_layer.h', 'shader.cc', 'shader.h', - 'skpicture_canvas_layer_updater.cc', - 'skpicture_canvas_layer_updater.h', + 'skpicture_content_layer_updater.cc', + 'skpicture_content_layer_updater.h', 'solid_color_layer.cc', 'solid_color_layer.h', 'switches.cc', diff --git a/cc/content_layer.cc b/cc/content_layer.cc index a75ee93..6eb58f6 100644 --- a/cc/content_layer.cc +++ b/cc/content_layer.cc @@ -8,8 +8,8 @@ #include "base/metrics/histogram.h" #include "base/time.h" -#include "cc/bitmap_canvas_layer_updater.h" -#include "cc/bitmap_skpicture_canvas_layer_updater.h" +#include "cc/bitmap_content_layer_updater.h" +#include "cc/bitmap_skpicture_content_layer_updater.h" #include "cc/content_layer_client.h" #include "cc/layer_painter.h" #include "cc/layer_tree_host.h" @@ -88,11 +88,11 @@ void ContentLayer::createUpdaterIfNeeded() return; scoped_ptr<LayerPainter> painter = ContentLayerPainter::create(m_client).PassAs<LayerPainter>(); if (layerTreeHost()->settings().acceleratePainting) - m_updater = SkPictureCanvasLayerUpdater::create(painter.Pass()); + m_updater = SkPictureContentLayerUpdater::create(painter.Pass()); else if (Settings::perTilePaintingEnabled()) - m_updater = BitmapSkPictureCanvasLayerUpdater::create(painter.Pass()); + m_updater = BitmapSkPictureContentLayerUpdater::create(painter.Pass()); else - m_updater = BitmapCanvasLayerUpdater::create(painter.Pass()); + m_updater = BitmapContentLayerUpdater::create(painter.Pass()); m_updater->setOpaque(contentsOpaque()); GLenum textureFormat = layerTreeHost()->rendererCapabilities().bestTextureFormat; diff --git a/cc/content_layer_unittest.cc b/cc/content_layer_unittest.cc index 6582690..3287aeb 100644 --- a/cc/content_layer_unittest.cc +++ b/cc/content_layer_unittest.cc @@ -6,7 +6,7 @@ #include "cc/content_layer.h" -#include "cc/bitmap_canvas_layer_updater.h" +#include "cc/bitmap_content_layer_updater.h" #include "cc/content_layer_client.h" #include "cc/rendering_stats.h" #include "cc/test/geometry_test_utils.h" @@ -44,7 +44,7 @@ TEST(ContentLayerTest, ContentLayerPainterWithDeviceScale) IntRect opaqueRectInContentSpace = opaqueRectInLayerSpace; opaqueRectInContentSpace.scale(contentsScale); MockContentLayerClient client(opaqueRectInLayerSpace); - scoped_refptr<BitmapCanvasLayerUpdater> updater = BitmapCanvasLayerUpdater::create(ContentLayerPainter::create(&client).PassAs<LayerPainter>()); + scoped_refptr<BitmapContentLayerUpdater> updater = BitmapContentLayerUpdater::create(ContentLayerPainter::create(&client).PassAs<LayerPainter>()); IntRect resultingOpaqueRect; RenderingStats stats; diff --git a/cc/canvas_layer_updater.cc b/cc/content_layer_updater.cc index 96f6b7f..b151bfb 100644 --- a/cc/canvas_layer_updater.cc +++ b/cc/content_layer_updater.cc @@ -4,7 +4,7 @@ #include "config.h" -#include "cc/canvas_layer_updater.h" +#include "cc/content_layer_updater.h" #include "FloatRect.h" #include "SkiaUtils.h" @@ -18,18 +18,18 @@ namespace cc { -CanvasLayerUpdater::CanvasLayerUpdater(scoped_ptr<LayerPainter> painter) +ContentLayerUpdater::ContentLayerUpdater(scoped_ptr<LayerPainter> painter) : m_painter(painter.Pass()) { } -CanvasLayerUpdater::~CanvasLayerUpdater() +ContentLayerUpdater::~ContentLayerUpdater() { } -void CanvasLayerUpdater::paintContents(SkCanvas* canvas, const IntRect& contentRect, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, RenderingStats& stats) +void ContentLayerUpdater::paintContents(SkCanvas* canvas, const IntRect& contentRect, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, RenderingStats& stats) { - TRACE_EVENT0("cc", "CanvasLayerUpdater::paintContents"); + TRACE_EVENT0("cc", "ContentLayerUpdater::paintContents"); canvas->save(); canvas->translate(FloatToSkScalar(-contentRect.x()), FloatToSkScalar(-contentRect.y())); diff --git a/cc/canvas_layer_updater.h b/cc/content_layer_updater.h index 7af78ef..4d59587 100644 --- a/cc/canvas_layer_updater.h +++ b/cc/content_layer_updater.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CanvasLayerUpdater_h -#define CanvasLayerUpdater_h +#ifndef ContentLayerUpdater_h +#define ContentLayerUpdater_h #include "cc/layer_updater.h" @@ -13,13 +13,13 @@ namespace cc { class LayerPainter; -// Base class for BitmapCanvasLayerUpdater and -// SkPictureCanvasLayerUpdater that reduces code duplication between +// Base class for BitmapContentLayerUpdater and +// SkPictureContentLayerUpdater that reduces code duplication between // their respective paintContents implementations. -class CanvasLayerUpdater : public LayerUpdater { +class ContentLayerUpdater : public LayerUpdater { protected: - explicit CanvasLayerUpdater(scoped_ptr<LayerPainter>); - virtual ~CanvasLayerUpdater(); + explicit ContentLayerUpdater(scoped_ptr<LayerPainter>); + virtual ~ContentLayerUpdater(); void paintContents(SkCanvas*, const IntRect& contentRect, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, RenderingStats&); const IntRect& contentRect() const { return m_contentRect; } @@ -31,4 +31,4 @@ private: } // namespace cc -#endif // CanvasLayerUpdater_h +#endif // ContentLayerUpdater_h diff --git a/cc/scrollbar_layer.cc b/cc/scrollbar_layer.cc index 9ed4778..d30b836 100644 --- a/cc/scrollbar_layer.cc +++ b/cc/scrollbar_layer.cc @@ -191,25 +191,25 @@ void ScrollbarLayer::createUpdaterIfNeeded() m_textureFormat = layerTreeHost()->rendererCapabilities().bestTextureFormat; if (!m_backTrackUpdater) - m_backTrackUpdater = CachingBitmapCanvasLayerUpdater::Create(ScrollbarBackgroundPainter::create(m_scrollbar.get(), m_painter, m_geometry.get(), WebKit::WebScrollbar::BackTrackPart).PassAs<LayerPainter>()); + m_backTrackUpdater = CachingBitmapContentLayerUpdater::Create(ScrollbarBackgroundPainter::create(m_scrollbar.get(), m_painter, m_geometry.get(), WebKit::WebScrollbar::BackTrackPart).PassAs<LayerPainter>()); if (!m_backTrack) m_backTrack = m_backTrackUpdater->createResource(layerTreeHost()->contentsTextureManager()); // Only create two-part track if we think the two parts could be different in appearance. if (m_scrollbar->isCustomScrollbar()) { if (!m_foreTrackUpdater) - m_foreTrackUpdater = CachingBitmapCanvasLayerUpdater::Create(ScrollbarBackgroundPainter::create(m_scrollbar.get(), m_painter, m_geometry.get(), WebKit::WebScrollbar::ForwardTrackPart).PassAs<LayerPainter>()); + m_foreTrackUpdater = CachingBitmapContentLayerUpdater::Create(ScrollbarBackgroundPainter::create(m_scrollbar.get(), m_painter, m_geometry.get(), WebKit::WebScrollbar::ForwardTrackPart).PassAs<LayerPainter>()); if (!m_foreTrack) m_foreTrack = m_foreTrackUpdater->createResource(layerTreeHost()->contentsTextureManager()); } if (!m_thumbUpdater) - m_thumbUpdater = CachingBitmapCanvasLayerUpdater::Create(ScrollbarThumbPainter::create(m_scrollbar.get(), m_painter, m_geometry.get()).PassAs<LayerPainter>()); + m_thumbUpdater = CachingBitmapContentLayerUpdater::Create(ScrollbarThumbPainter::create(m_scrollbar.get(), m_painter, m_geometry.get()).PassAs<LayerPainter>()); if (!m_thumb) m_thumb = m_thumbUpdater->createResource(layerTreeHost()->contentsTextureManager()); } -void ScrollbarLayer::updatePart(CachingBitmapCanvasLayerUpdater* painter, LayerUpdater::Resource* texture, const IntRect& rect, TextureUpdateQueue& queue, RenderingStats& stats) +void ScrollbarLayer::updatePart(CachingBitmapContentLayerUpdater* painter, LayerUpdater::Resource* texture, const IntRect& rect, TextureUpdateQueue& queue, RenderingStats& stats) { // Skip painting and uploading if there are no invalidations and // we already have valid texture data. diff --git a/cc/scrollbar_layer.h b/cc/scrollbar_layer.h index cfa2fc3..885bea9 100644 --- a/cc/scrollbar_layer.h +++ b/cc/scrollbar_layer.h @@ -6,7 +6,7 @@ #ifndef ScrollbarLayerChromium_h #define ScrollbarLayerChromium_h -#include "caching_bitmap_canvas_layer_updater.h" +#include "caching_bitmap_content_layer_updater.h" #include "cc/layer.h" #include <public/WebScrollbar.h> #include <public/WebScrollbarThemeGeometry.h> @@ -42,7 +42,7 @@ protected: virtual ~ScrollbarLayer(); private: - void updatePart(CachingBitmapCanvasLayerUpdater*, LayerUpdater::Resource*, const IntRect&, TextureUpdateQueue&, RenderingStats&); + void updatePart(CachingBitmapContentLayerUpdater*, LayerUpdater::Resource*, const IntRect&, TextureUpdateQueue&, RenderingStats&); void createUpdaterIfNeeded(); scoped_ptr<WebKit::WebScrollbar> m_scrollbar; @@ -52,9 +52,9 @@ private: GLenum m_textureFormat; - scoped_refptr<CachingBitmapCanvasLayerUpdater> m_backTrackUpdater; - scoped_refptr<CachingBitmapCanvasLayerUpdater> m_foreTrackUpdater; - scoped_refptr<CachingBitmapCanvasLayerUpdater> m_thumbUpdater; + scoped_refptr<CachingBitmapContentLayerUpdater> m_backTrackUpdater; + scoped_refptr<CachingBitmapContentLayerUpdater> m_foreTrackUpdater; + scoped_refptr<CachingBitmapContentLayerUpdater> m_thumbUpdater; // All the parts of the scrollbar except the thumb scoped_ptr<LayerUpdater::Resource> m_backTrack; diff --git a/cc/skpicture_canvas_layer_updater.cc b/cc/skpicture_canvas_layer_updater.cc deleted file mode 100644 index ddf6428..0000000 --- a/cc/skpicture_canvas_layer_updater.cc +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "config.h" - -#include "cc/skpicture_canvas_layer_updater.h" - -#include "base/debug/trace_event.h" -#include "cc/layer_painter.h" -#include "cc/texture_update_queue.h" -#include "third_party/skia/include/core/SkCanvas.h" - -namespace cc { - -SkPictureCanvasLayerUpdater::Resource::Resource(SkPictureCanvasLayerUpdater* updater, scoped_ptr<PrioritizedTexture> texture) - : LayerUpdater::Resource(texture.Pass()) - , m_updater(updater) -{ -} - -SkPictureCanvasLayerUpdater::Resource::~Resource() -{ -} - -void SkPictureCanvasLayerUpdater::Resource::update(TextureUpdateQueue& queue, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&) -{ - updater()->updateTexture(queue, texture(), sourceRect, destOffset, partialUpdate); -} - -SkPictureCanvasLayerUpdater::SkPictureCanvasLayerUpdater(scoped_ptr<LayerPainter> painter) - : CanvasLayerUpdater(painter.Pass()) - , m_layerIsOpaque(false) -{ -} - -SkPictureCanvasLayerUpdater::~SkPictureCanvasLayerUpdater() -{ -} - -scoped_refptr<SkPictureCanvasLayerUpdater> SkPictureCanvasLayerUpdater::create(scoped_ptr<LayerPainter> painter) -{ - return make_scoped_refptr(new SkPictureCanvasLayerUpdater(painter.Pass())); -} - -scoped_ptr<LayerUpdater::Resource> SkPictureCanvasLayerUpdater::createResource(PrioritizedTextureManager* manager) -{ - return scoped_ptr<LayerUpdater::Resource>(new Resource(this, PrioritizedTexture::create(manager))); -} - -void SkPictureCanvasLayerUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, RenderingStats& stats) -{ - SkCanvas* canvas = m_picture.beginRecording(contentRect.width(), contentRect.height()); - paintContents(canvas, contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect, stats); - m_picture.endRecording(); -} - -void SkPictureCanvasLayerUpdater::drawPicture(SkCanvas* canvas) -{ - TRACE_EVENT0("cc", "SkPictureCanvasLayerUpdater::drawPicture"); - canvas->drawPicture(m_picture); -} - -void SkPictureCanvasLayerUpdater::updateTexture(TextureUpdateQueue& queue, PrioritizedTexture* texture, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate) -{ - ResourceUpdate upload = ResourceUpdate::CreateFromPicture( - texture, &m_picture, contentRect(), sourceRect, destOffset); - if (partialUpdate) - queue.appendPartialUpload(upload); - else - queue.appendFullUpload(upload); -} - -void SkPictureCanvasLayerUpdater::setOpaque(bool opaque) -{ - m_layerIsOpaque = opaque; -} - -} // namespace cc diff --git a/cc/skpicture_content_layer_updater.cc b/cc/skpicture_content_layer_updater.cc new file mode 100644 index 0000000..7eff91c --- /dev/null +++ b/cc/skpicture_content_layer_updater.cc @@ -0,0 +1,79 @@ +// Copyright 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "config.h" + +#include "cc/skpicture_content_layer_updater.h" + +#include "base/debug/trace_event.h" +#include "cc/layer_painter.h" +#include "cc/texture_update_queue.h" +#include "third_party/skia/include/core/SkCanvas.h" + +namespace cc { + +SkPictureContentLayerUpdater::Resource::Resource(SkPictureContentLayerUpdater* updater, scoped_ptr<PrioritizedTexture> texture) + : LayerUpdater::Resource(texture.Pass()) + , m_updater(updater) +{ +} + +SkPictureContentLayerUpdater::Resource::~Resource() +{ +} + +void SkPictureContentLayerUpdater::Resource::update(TextureUpdateQueue& queue, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&) +{ + updater()->updateTexture(queue, texture(), sourceRect, destOffset, partialUpdate); +} + +SkPictureContentLayerUpdater::SkPictureContentLayerUpdater(scoped_ptr<LayerPainter> painter) + : ContentLayerUpdater(painter.Pass()) + , m_layerIsOpaque(false) +{ +} + +SkPictureContentLayerUpdater::~SkPictureContentLayerUpdater() +{ +} + +scoped_refptr<SkPictureContentLayerUpdater> SkPictureContentLayerUpdater::create(scoped_ptr<LayerPainter> painter) +{ + return make_scoped_refptr(new SkPictureContentLayerUpdater(painter.Pass())); +} + +scoped_ptr<LayerUpdater::Resource> SkPictureContentLayerUpdater::createResource(PrioritizedTextureManager* manager) +{ + return scoped_ptr<LayerUpdater::Resource>(new Resource(this, PrioritizedTexture::create(manager))); +} + +void SkPictureContentLayerUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, RenderingStats& stats) +{ + SkCanvas* canvas = m_picture.beginRecording(contentRect.width(), contentRect.height()); + paintContents(canvas, contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect, stats); + m_picture.endRecording(); +} + +void SkPictureContentLayerUpdater::drawPicture(SkCanvas* canvas) +{ + TRACE_EVENT0("cc", "SkPictureContentLayerUpdater::drawPicture"); + canvas->drawPicture(m_picture); +} + +void SkPictureContentLayerUpdater::updateTexture(TextureUpdateQueue& queue, PrioritizedTexture* texture, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate) +{ + ResourceUpdate upload = ResourceUpdate::CreateFromPicture( + texture, &m_picture, contentRect(), sourceRect, destOffset); + if (partialUpdate) + queue.appendPartialUpload(upload); + else + queue.appendFullUpload(upload); +} + +void SkPictureContentLayerUpdater::setOpaque(bool opaque) +{ + m_layerIsOpaque = opaque; +} + +} // namespace cc diff --git a/cc/skpicture_canvas_layer_updater.h b/cc/skpicture_content_layer_updater.h index 2cac07c..685ee39 100644 --- a/cc/skpicture_canvas_layer_updater.h +++ b/cc/skpicture_content_layer_updater.h @@ -3,10 +3,10 @@ // found in the LICENSE file. -#ifndef SkPictureCanvasLayerUpdater_h -#define SkPictureCanvasLayerUpdater_h +#ifndef SkPictureContentLayerUpdater_h +#define SkPictureContentLayerUpdater_h -#include "cc/canvas_layer_updater.h" +#include "cc/content_layer_updater.h" #include "third_party/skia/include/core/SkPicture.h" class SkCanvas; @@ -17,32 +17,32 @@ class LayerPainter; // This class records the contentRect into an SkPicture. Subclasses, provide // different implementations of tile updating based on this recorded picture. -// The BitmapSkPictureCanvasLayerUpdater and -// FrameBufferSkPictureCanvasLayerUpdater are two examples of such +// The BitmapSkPictureContentLayerUpdater and +// FrameBufferSkPictureContentLayerUpdater are two examples of such // implementations. -class SkPictureCanvasLayerUpdater : public CanvasLayerUpdater { +class SkPictureContentLayerUpdater : public ContentLayerUpdater { public: class Resource : public LayerUpdater::Resource { public: - Resource(SkPictureCanvasLayerUpdater*, scoped_ptr<PrioritizedTexture>); + Resource(SkPictureContentLayerUpdater*, scoped_ptr<PrioritizedTexture>); virtual ~Resource(); virtual void update(TextureUpdateQueue&, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE; private: - SkPictureCanvasLayerUpdater* updater() { return m_updater; } + SkPictureContentLayerUpdater* updater() { return m_updater; } - SkPictureCanvasLayerUpdater* m_updater; + SkPictureContentLayerUpdater* m_updater; }; - static scoped_refptr<SkPictureCanvasLayerUpdater> create(scoped_ptr<LayerPainter>); + static scoped_refptr<SkPictureContentLayerUpdater> create(scoped_ptr<LayerPainter>); virtual scoped_ptr<LayerUpdater::Resource> createResource(PrioritizedTextureManager*) OVERRIDE; virtual void setOpaque(bool) OVERRIDE; protected: - explicit SkPictureCanvasLayerUpdater(scoped_ptr<LayerPainter>); - virtual ~SkPictureCanvasLayerUpdater(); + explicit SkPictureContentLayerUpdater(scoped_ptr<LayerPainter>); + virtual ~SkPictureContentLayerUpdater(); virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, RenderingStats&) OVERRIDE; void drawPicture(SkCanvas*); @@ -58,4 +58,4 @@ private: }; } // namespace cc -#endif // SkPictureCanvasLayerUpdater_h +#endif // SkPictureContentLayerUpdater_h diff --git a/cc/tiled_layer_unittest.cc b/cc/tiled_layer_unittest.cc index dec3209..3c78e27 100644 --- a/cc/tiled_layer_unittest.cc +++ b/cc/tiled_layer_unittest.cc @@ -6,7 +6,7 @@ #include "cc/tiled_layer.h" -#include "cc/bitmap_canvas_layer_updater.h" +#include "cc/bitmap_content_layer_updater.h" #include "cc/layer_painter.h" #include "cc/overdraw_metrics.h" #include "cc/rendering_stats.h" @@ -1549,7 +1549,7 @@ public: { scoped_ptr<TrackingLayerPainter> trackingLayerPainter(TrackingLayerPainter::create()); m_trackingLayerPainter = trackingLayerPainter.get(); - m_layerUpdater = BitmapCanvasLayerUpdater::create(trackingLayerPainter.PassAs<LayerPainter>()); + m_layerUpdater = BitmapContentLayerUpdater::create(trackingLayerPainter.PassAs<LayerPainter>()); } TrackingLayerPainter* trackingLayerPainter() const { return m_trackingLayerPainter; } @@ -1561,7 +1561,7 @@ protected: private: TrackingLayerPainter* m_trackingLayerPainter; - scoped_refptr<BitmapCanvasLayerUpdater> m_layerUpdater; + scoped_refptr<BitmapContentLayerUpdater> m_layerUpdater; }; TEST_F(TiledLayerTest, nonIntegerContentsScaleIsNotDistortedDuringPaint) |