summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-23 18:34:51 +0000
committerreveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-23 18:34:51 +0000
commit64d8d39667043c562e0e1b0384c1e662b1accfc1 (patch)
tree458a6d9ce8fdef0b56d56d9b8840c6bc17ae5d43
parent589029cb1163bf74ae28b5ba7880fac6b9d099c6 (diff)
downloadchromium_src-64d8d39667043c562e0e1b0384c1e662b1accfc1.zip
chromium_src-64d8d39667043c562e0e1b0384c1e662b1accfc1.tar.gz
chromium_src-64d8d39667043c562e0e1b0384c1e662b1accfc1.tar.bz2
cc: Rename LayerTextureUpdater to LayerUpdater.
sed -e ' s/TextureUpdater/Updater/g s/textureUpdater/updater/g s/texture_updater\.h/updater.h/g s/texture_updater\.cc/updater.cc/g s/TEXTURE_UPDATER_H_/UPDATER_H_/g ' BUG= TEST=cc_unittests Review URL: https://codereview.chromium.org/11231082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163615 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--cc/bitmap_canvas_layer_texture_updater.cc84
-rw-r--r--cc/bitmap_canvas_layer_updater.cc84
-rw-r--r--cc/bitmap_canvas_layer_updater.h (renamed from cc/bitmap_canvas_layer_texture_updater.h)26
-rw-r--r--cc/bitmap_skpicture_canvas_layer_texture_updater.cc72
-rw-r--r--cc/bitmap_skpicture_canvas_layer_texture_updater.h42
-rw-r--r--cc/bitmap_skpicture_canvas_layer_updater.cc72
-rw-r--r--cc/bitmap_skpicture_canvas_layer_updater.h42
-rw-r--r--cc/caching_bitmap_canvas_layer_updater.cc (renamed from cc/caching_bitmap_canvas_layer_texture_updater.cc)22
-rw-r--r--cc/caching_bitmap_canvas_layer_updater.h (renamed from cc/caching_bitmap_canvas_layer_texture_updater.h)18
-rw-r--r--cc/canvas_layer_updater.cc (renamed from cc/canvas_layer_texture_updater.cc)10
-rw-r--r--cc/canvas_layer_updater.h (renamed from cc/canvas_layer_texture_updater.h)18
-rw-r--r--cc/cc.gyp24
-rw-r--r--cc/content_layer.cc26
-rw-r--r--cc/content_layer.h8
-rw-r--r--cc/content_layer_unittest.cc4
-rw-r--r--cc/image_layer.cc44
-rw-r--r--cc/image_layer.h8
-rw-r--r--cc/layer_updater.cc (renamed from cc/layer_texture_updater.cc)6
-rw-r--r--cc/layer_updater.h (renamed from cc/layer_texture_updater.h)14
-rw-r--r--cc/scrollbar_layer.cc14
-rw-r--r--cc/scrollbar_layer.h18
-rw-r--r--cc/skpicture_canvas_layer_texture_updater.cc79
-rw-r--r--cc/skpicture_canvas_layer_updater.cc79
-rw-r--r--cc/skpicture_canvas_layer_updater.h (renamed from cc/skpicture_canvas_layer_texture_updater.h)30
-rw-r--r--cc/test/tiled_layer_test_common.cc26
-rw-r--r--cc/test/tiled_layer_test_common.h24
-rw-r--r--cc/tiled_layer.cc20
-rw-r--r--cc/tiled_layer.h6
-rw-r--r--cc/tiled_layer_unittest.cc140
29 files changed, 530 insertions, 530 deletions
diff --git a/cc/bitmap_canvas_layer_texture_updater.cc b/cc/bitmap_canvas_layer_texture_updater.cc
deleted file mode 100644
index e874e76..0000000
--- a/cc/bitmap_canvas_layer_texture_updater.cc
+++ /dev/null
@@ -1,84 +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/bitmap_canvas_layer_texture_updater.h"
-
-#include "cc/layer_painter.h"
-#include "cc/resource_update.h"
-#include "cc/texture_update_queue.h"
-#include "skia/ext/platform_canvas.h"
-
-namespace cc {
-
-BitmapCanvasLayerTextureUpdater::Texture::Texture(BitmapCanvasLayerTextureUpdater* textureUpdater, scoped_ptr<PrioritizedTexture> texture)
- : LayerTextureUpdater::Texture(texture.Pass())
- , m_textureUpdater(textureUpdater)
-{
-}
-
-BitmapCanvasLayerTextureUpdater::Texture::~Texture()
-{
-}
-
-void BitmapCanvasLayerTextureUpdater::Texture::update(TextureUpdateQueue& queue, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&)
-{
- textureUpdater()->updateTexture(queue, texture(), sourceRect, destOffset, partialUpdate);
-}
-
-scoped_refptr<BitmapCanvasLayerTextureUpdater> BitmapCanvasLayerTextureUpdater::create(scoped_ptr<LayerPainter> painter)
-{
- return make_scoped_refptr(new BitmapCanvasLayerTextureUpdater(painter.Pass()));
-}
-
-BitmapCanvasLayerTextureUpdater::BitmapCanvasLayerTextureUpdater(scoped_ptr<LayerPainter> painter)
- : CanvasLayerTextureUpdater(painter.Pass())
- , m_opaque(false)
-{
-}
-
-BitmapCanvasLayerTextureUpdater::~BitmapCanvasLayerTextureUpdater()
-{
-}
-
-scoped_ptr<LayerTextureUpdater::Texture> BitmapCanvasLayerTextureUpdater::createTexture(PrioritizedTextureManager* manager)
-{
- return scoped_ptr<LayerTextureUpdater::Texture>(new Texture(this, PrioritizedTexture::create(manager)));
-}
-
-void BitmapCanvasLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, RenderingStats& stats)
-{
- if (m_canvasSize != contentRect.size()) {
- m_canvasSize = contentRect.size();
- m_canvas = make_scoped_ptr(skia::CreateBitmapCanvas(m_canvasSize.width(), m_canvasSize.height(), m_opaque));
- }
-
- paintContents(m_canvas.get(), contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect, stats);
-}
-
-void BitmapCanvasLayerTextureUpdater::updateTexture(TextureUpdateQueue& queue, PrioritizedTexture* texture, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate)
-{
- ResourceUpdate upload = ResourceUpdate::Create(
- texture,
- &m_canvas->getDevice()->accessBitmap(false),
- contentRect(),
- sourceRect,
- destOffset);
- if (partialUpdate)
- queue.appendPartialUpload(upload);
- else
- queue.appendFullUpload(upload);
-}
-
-void BitmapCanvasLayerTextureUpdater::setOpaque(bool opaque)
-{
- if (opaque != m_opaque) {
- m_canvas.reset();
- m_canvasSize = IntSize();
- }
- m_opaque = opaque;
-}
-
-} // namespace cc
diff --git a/cc/bitmap_canvas_layer_updater.cc b/cc/bitmap_canvas_layer_updater.cc
new file mode 100644
index 0000000..eca5e761
--- /dev/null
+++ b/cc/bitmap_canvas_layer_updater.cc
@@ -0,0 +1,84 @@
+// 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/bitmap_canvas_layer_updater.h"
+
+#include "cc/layer_painter.h"
+#include "cc/resource_update.h"
+#include "cc/texture_update_queue.h"
+#include "skia/ext/platform_canvas.h"
+
+namespace cc {
+
+BitmapCanvasLayerUpdater::Texture::Texture(BitmapCanvasLayerUpdater* updater, scoped_ptr<PrioritizedTexture> texture)
+ : LayerUpdater::Texture(texture.Pass())
+ , m_updater(updater)
+{
+}
+
+BitmapCanvasLayerUpdater::Texture::~Texture()
+{
+}
+
+void BitmapCanvasLayerUpdater::Texture::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)
+{
+ return make_scoped_refptr(new BitmapCanvasLayerUpdater(painter.Pass()));
+}
+
+BitmapCanvasLayerUpdater::BitmapCanvasLayerUpdater(scoped_ptr<LayerPainter> painter)
+ : CanvasLayerUpdater(painter.Pass())
+ , m_opaque(false)
+{
+}
+
+BitmapCanvasLayerUpdater::~BitmapCanvasLayerUpdater()
+{
+}
+
+scoped_ptr<LayerUpdater::Texture> BitmapCanvasLayerUpdater::createTexture(PrioritizedTextureManager* manager)
+{
+ return scoped_ptr<LayerUpdater::Texture>(new Texture(this, PrioritizedTexture::create(manager)));
+}
+
+void BitmapCanvasLayerUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, RenderingStats& stats)
+{
+ if (m_canvasSize != contentRect.size()) {
+ m_canvasSize = contentRect.size();
+ m_canvas = make_scoped_ptr(skia::CreateBitmapCanvas(m_canvasSize.width(), m_canvasSize.height(), m_opaque));
+ }
+
+ paintContents(m_canvas.get(), contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect, stats);
+}
+
+void BitmapCanvasLayerUpdater::updateTexture(TextureUpdateQueue& queue, PrioritizedTexture* texture, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate)
+{
+ ResourceUpdate upload = ResourceUpdate::Create(
+ texture,
+ &m_canvas->getDevice()->accessBitmap(false),
+ contentRect(),
+ sourceRect,
+ destOffset);
+ if (partialUpdate)
+ queue.appendPartialUpload(upload);
+ else
+ queue.appendFullUpload(upload);
+}
+
+void BitmapCanvasLayerUpdater::setOpaque(bool opaque)
+{
+ if (opaque != m_opaque) {
+ m_canvas.reset();
+ m_canvasSize = IntSize();
+ }
+ m_opaque = opaque;
+}
+
+} // namespace cc
diff --git a/cc/bitmap_canvas_layer_texture_updater.h b/cc/bitmap_canvas_layer_updater.h
index 1225e0e..bd36be2 100644
--- a/cc/bitmap_canvas_layer_texture_updater.h
+++ b/cc/bitmap_canvas_layer_updater.h
@@ -3,10 +3,10 @@
// found in the LICENSE file.
-#ifndef BitmapCanvasLayerTextureUpdater_h
-#define BitmapCanvasLayerTextureUpdater_h
+#ifndef BitmapCanvasLayerUpdater_h
+#define BitmapCanvasLayerUpdater_h
-#include "cc/canvas_layer_texture_updater.h"
+#include "cc/canvas_layer_updater.h"
class SkCanvas;
@@ -17,32 +17,32 @@ 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 BitmapCanvasLayerTextureUpdater : public CanvasLayerTextureUpdater {
+class BitmapCanvasLayerUpdater : public CanvasLayerUpdater {
public:
- class Texture : public LayerTextureUpdater::Texture {
+ class Texture : public LayerUpdater::Texture {
public:
- Texture(BitmapCanvasLayerTextureUpdater*, scoped_ptr<PrioritizedTexture>);
+ Texture(BitmapCanvasLayerUpdater*, scoped_ptr<PrioritizedTexture>);
virtual ~Texture();
virtual void update(TextureUpdateQueue&, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE;
private:
- BitmapCanvasLayerTextureUpdater* textureUpdater() { return m_textureUpdater; }
+ BitmapCanvasLayerUpdater* updater() { return m_updater; }
- BitmapCanvasLayerTextureUpdater* m_textureUpdater;
+ BitmapCanvasLayerUpdater* m_updater;
};
- static scoped_refptr<BitmapCanvasLayerTextureUpdater> create(scoped_ptr<LayerPainter>);
+ static scoped_refptr<BitmapCanvasLayerUpdater> create(scoped_ptr<LayerPainter>);
- virtual scoped_ptr<LayerTextureUpdater::Texture> createTexture(PrioritizedTextureManager*) OVERRIDE;
+ virtual scoped_ptr<LayerUpdater::Texture> createTexture(PrioritizedTextureManager*) OVERRIDE;
virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, RenderingStats&) OVERRIDE;
void updateTexture(TextureUpdateQueue&, PrioritizedTexture*, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate);
virtual void setOpaque(bool) OVERRIDE;
protected:
- explicit BitmapCanvasLayerTextureUpdater(scoped_ptr<LayerPainter>);
- virtual ~BitmapCanvasLayerTextureUpdater();
+ explicit BitmapCanvasLayerUpdater(scoped_ptr<LayerPainter>);
+ virtual ~BitmapCanvasLayerUpdater();
scoped_ptr<SkCanvas> m_canvas;
IntSize m_canvasSize;
@@ -51,4 +51,4 @@ protected:
} // namespace cc
-#endif // BitmapCanvasLayerTextureUpdater_h
+#endif // BitmapCanvasLayerUpdater_h
diff --git a/cc/bitmap_skpicture_canvas_layer_texture_updater.cc b/cc/bitmap_skpicture_canvas_layer_texture_updater.cc
deleted file mode 100644
index fc342b9..0000000
--- a/cc/bitmap_skpicture_canvas_layer_texture_updater.cc
+++ /dev/null
@@ -1,72 +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/bitmap_skpicture_canvas_layer_texture_updater.h"
-
-#include "base/time.h"
-#include "cc/layer_painter.h"
-#include "cc/rendering_stats.h"
-#include "cc/texture_update_queue.h"
-#include "third_party/skia/include/core/SkCanvas.h"
-#include "third_party/skia/include/core/SkDevice.h"
-
-namespace cc {
-
-BitmapSkPictureCanvasLayerTextureUpdater::Texture::Texture(BitmapSkPictureCanvasLayerTextureUpdater* textureUpdater, scoped_ptr<PrioritizedTexture> texture)
- : CanvasLayerTextureUpdater::Texture(texture.Pass())
- , m_textureUpdater(textureUpdater)
-{
-}
-
-void BitmapSkPictureCanvasLayerTextureUpdater::Texture::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();
- m_bitmap.setIsOpaque(m_textureUpdater->layerIsOpaque());
- SkDevice device(m_bitmap);
- SkCanvas canvas(&device);
- base::TimeTicks paintBeginTime = base::TimeTicks::Now();
- textureUpdater()->paintContentsRect(&canvas, sourceRect, stats);
- stats.totalPaintTimeInSeconds += (base::TimeTicks::Now() - paintBeginTime).InSecondsF();
-
- ResourceUpdate upload = ResourceUpdate::Create(
- texture(), &m_bitmap, sourceRect, sourceRect, destOffset);
- if (partialUpdate)
- queue.appendPartialUpload(upload);
- else
- queue.appendFullUpload(upload);
-}
-
-scoped_refptr<BitmapSkPictureCanvasLayerTextureUpdater> BitmapSkPictureCanvasLayerTextureUpdater::create(scoped_ptr<LayerPainter> painter)
-{
- return make_scoped_refptr(new BitmapSkPictureCanvasLayerTextureUpdater(painter.Pass()));
-}
-
-BitmapSkPictureCanvasLayerTextureUpdater::BitmapSkPictureCanvasLayerTextureUpdater(scoped_ptr<LayerPainter> painter)
- : SkPictureCanvasLayerTextureUpdater(painter.Pass())
-{
-}
-
-BitmapSkPictureCanvasLayerTextureUpdater::~BitmapSkPictureCanvasLayerTextureUpdater()
-{
-}
-
-scoped_ptr<LayerTextureUpdater::Texture> BitmapSkPictureCanvasLayerTextureUpdater::createTexture(PrioritizedTextureManager* manager)
-{
- return scoped_ptr<LayerTextureUpdater::Texture>(new Texture(this, PrioritizedTexture::create(manager)));
-}
-
-void BitmapSkPictureCanvasLayerTextureUpdater::paintContentsRect(SkCanvas* canvas, const IntRect& sourceRect, RenderingStats& stats)
-{
- // Translate the origin of contentRect to that of sourceRect.
- canvas->translate(contentRect().x() - sourceRect.x(),
- contentRect().y() - sourceRect.y());
- base::TimeTicks rasterizeBeginTime = base::TimeTicks::Now();
- drawPicture(canvas);
- stats.totalRasterizeTimeInSeconds += (base::TimeTicks::Now() - rasterizeBeginTime).InSecondsF();
-}
-
-} // namespace cc
diff --git a/cc/bitmap_skpicture_canvas_layer_texture_updater.h b/cc/bitmap_skpicture_canvas_layer_texture_updater.h
deleted file mode 100644
index 5935ae4..0000000
--- a/cc/bitmap_skpicture_canvas_layer_texture_updater.h
+++ /dev/null
@@ -1,42 +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.
-
-#ifndef BitmapSkPictureCanvasLayerTextureUpdater_h
-#define BitmapSkPictureCanvasLayerTextureUpdater_h
-
-#include "cc/skpicture_canvas_layer_texture_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 BitmapSkPictureCanvasLayerTextureUpdater : public SkPictureCanvasLayerTextureUpdater {
-public:
- class Texture : public CanvasLayerTextureUpdater::Texture {
- public:
- Texture(BitmapSkPictureCanvasLayerTextureUpdater*, scoped_ptr<PrioritizedTexture>);
-
- virtual void update(TextureUpdateQueue&, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE;
-
- private:
- BitmapSkPictureCanvasLayerTextureUpdater* textureUpdater() { return m_textureUpdater; }
-
- SkBitmap m_bitmap;
- BitmapSkPictureCanvasLayerTextureUpdater* m_textureUpdater;
- };
-
- static scoped_refptr<BitmapSkPictureCanvasLayerTextureUpdater> create(scoped_ptr<LayerPainter>);
-
- virtual scoped_ptr<LayerTextureUpdater::Texture> createTexture(PrioritizedTextureManager*) OVERRIDE;
- void paintContentsRect(SkCanvas*, const IntRect& sourceRect, RenderingStats&);
-
-private:
- explicit BitmapSkPictureCanvasLayerTextureUpdater(scoped_ptr<LayerPainter>);
- virtual ~BitmapSkPictureCanvasLayerTextureUpdater();
-};
-
-} // namespace cc
-
-#endif // BitmapSkPictureCanvasLayerTextureUpdater_h
diff --git a/cc/bitmap_skpicture_canvas_layer_updater.cc b/cc/bitmap_skpicture_canvas_layer_updater.cc
new file mode 100644
index 0000000..a8ae1ca
--- /dev/null
+++ b/cc/bitmap_skpicture_canvas_layer_updater.cc
@@ -0,0 +1,72 @@
+// 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/bitmap_skpicture_canvas_layer_updater.h"
+
+#include "base/time.h"
+#include "cc/layer_painter.h"
+#include "cc/rendering_stats.h"
+#include "cc/texture_update_queue.h"
+#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/core/SkDevice.h"
+
+namespace cc {
+
+BitmapSkPictureCanvasLayerUpdater::Texture::Texture(BitmapSkPictureCanvasLayerUpdater* updater, scoped_ptr<PrioritizedTexture> texture)
+ : CanvasLayerUpdater::Texture(texture.Pass())
+ , m_updater(updater)
+{
+}
+
+void BitmapSkPictureCanvasLayerUpdater::Texture::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();
+ m_bitmap.setIsOpaque(m_updater->layerIsOpaque());
+ SkDevice device(m_bitmap);
+ SkCanvas canvas(&device);
+ base::TimeTicks paintBeginTime = base::TimeTicks::Now();
+ updater()->paintContentsRect(&canvas, sourceRect, stats);
+ stats.totalPaintTimeInSeconds += (base::TimeTicks::Now() - paintBeginTime).InSecondsF();
+
+ ResourceUpdate upload = ResourceUpdate::Create(
+ texture(), &m_bitmap, sourceRect, sourceRect, destOffset);
+ if (partialUpdate)
+ queue.appendPartialUpload(upload);
+ else
+ queue.appendFullUpload(upload);
+}
+
+scoped_refptr<BitmapSkPictureCanvasLayerUpdater> BitmapSkPictureCanvasLayerUpdater::create(scoped_ptr<LayerPainter> painter)
+{
+ return make_scoped_refptr(new BitmapSkPictureCanvasLayerUpdater(painter.Pass()));
+}
+
+BitmapSkPictureCanvasLayerUpdater::BitmapSkPictureCanvasLayerUpdater(scoped_ptr<LayerPainter> painter)
+ : SkPictureCanvasLayerUpdater(painter.Pass())
+{
+}
+
+BitmapSkPictureCanvasLayerUpdater::~BitmapSkPictureCanvasLayerUpdater()
+{
+}
+
+scoped_ptr<LayerUpdater::Texture> BitmapSkPictureCanvasLayerUpdater::createTexture(PrioritizedTextureManager* manager)
+{
+ return scoped_ptr<LayerUpdater::Texture>(new Texture(this, PrioritizedTexture::create(manager)));
+}
+
+void BitmapSkPictureCanvasLayerUpdater::paintContentsRect(SkCanvas* canvas, const IntRect& sourceRect, RenderingStats& stats)
+{
+ // Translate the origin of contentRect to that of sourceRect.
+ canvas->translate(contentRect().x() - sourceRect.x(),
+ contentRect().y() - sourceRect.y());
+ base::TimeTicks rasterizeBeginTime = base::TimeTicks::Now();
+ drawPicture(canvas);
+ stats.totalRasterizeTimeInSeconds += (base::TimeTicks::Now() - rasterizeBeginTime).InSecondsF();
+}
+
+} // namespace cc
diff --git a/cc/bitmap_skpicture_canvas_layer_updater.h b/cc/bitmap_skpicture_canvas_layer_updater.h
new file mode 100644
index 0000000..b9e30a5
--- /dev/null
+++ b/cc/bitmap_skpicture_canvas_layer_updater.h
@@ -0,0 +1,42 @@
+// 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.
+
+#ifndef BitmapSkPictureCanvasLayerUpdater_h
+#define BitmapSkPictureCanvasLayerUpdater_h
+
+#include "cc/skpicture_canvas_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 {
+public:
+ class Texture : public CanvasLayerUpdater::Texture {
+ public:
+ Texture(BitmapSkPictureCanvasLayerUpdater*, scoped_ptr<PrioritizedTexture>);
+
+ virtual void update(TextureUpdateQueue&, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE;
+
+ private:
+ BitmapSkPictureCanvasLayerUpdater* updater() { return m_updater; }
+
+ SkBitmap m_bitmap;
+ BitmapSkPictureCanvasLayerUpdater* m_updater;
+ };
+
+ static scoped_refptr<BitmapSkPictureCanvasLayerUpdater> create(scoped_ptr<LayerPainter>);
+
+ virtual scoped_ptr<LayerUpdater::Texture> createTexture(PrioritizedTextureManager*) OVERRIDE;
+ void paintContentsRect(SkCanvas*, const IntRect& sourceRect, RenderingStats&);
+
+private:
+ explicit BitmapSkPictureCanvasLayerUpdater(scoped_ptr<LayerPainter>);
+ virtual ~BitmapSkPictureCanvasLayerUpdater();
+};
+
+} // namespace cc
+
+#endif // BitmapSkPictureCanvasLayerUpdater_h
diff --git a/cc/caching_bitmap_canvas_layer_texture_updater.cc b/cc/caching_bitmap_canvas_layer_updater.cc
index b6d6259..c16af60 100644
--- a/cc/caching_bitmap_canvas_layer_texture_updater.cc
+++ b/cc/caching_bitmap_canvas_layer_updater.cc
@@ -4,39 +4,39 @@
#include "config.h"
-#include "caching_bitmap_canvas_layer_texture_updater.h"
+#include "caching_bitmap_canvas_layer_updater.h"
#include "cc/layer_painter.h"
#include "skia/ext/platform_canvas.h"
namespace cc {
-scoped_refptr<CachingBitmapCanvasLayerTextureUpdater>
-CachingBitmapCanvasLayerTextureUpdater::Create(
+scoped_refptr<CachingBitmapCanvasLayerUpdater>
+CachingBitmapCanvasLayerUpdater::Create(
scoped_ptr<LayerPainter> painter) {
- return make_scoped_refptr(new CachingBitmapCanvasLayerTextureUpdater(
+ return make_scoped_refptr(new CachingBitmapCanvasLayerUpdater(
painter.Pass()));
}
-CachingBitmapCanvasLayerTextureUpdater::CachingBitmapCanvasLayerTextureUpdater(
+CachingBitmapCanvasLayerUpdater::CachingBitmapCanvasLayerUpdater(
scoped_ptr<LayerPainter> painter)
- : BitmapCanvasLayerTextureUpdater(painter.Pass()),
+ : BitmapCanvasLayerUpdater(painter.Pass()),
pixels_did_change_(false) {
}
-CachingBitmapCanvasLayerTextureUpdater::
- ~CachingBitmapCanvasLayerTextureUpdater()
+CachingBitmapCanvasLayerUpdater::
+ ~CachingBitmapCanvasLayerUpdater()
{
}
-void CachingBitmapCanvasLayerTextureUpdater::prepareToUpdate(
+void CachingBitmapCanvasLayerUpdater::prepareToUpdate(
const IntRect& content_rect,
const IntSize& tile_size,
float contents_width_scale,
float contents_height_scale,
IntRect& resulting_opaque_rect,
RenderingStats& stats) {
- BitmapCanvasLayerTextureUpdater::prepareToUpdate(content_rect,
+ BitmapCanvasLayerUpdater::prepareToUpdate(content_rect,
tile_size,
contents_width_scale,
contents_height_scale,
@@ -57,7 +57,7 @@ void CachingBitmapCanvasLayerTextureUpdater::prepareToUpdate(
new_bitmap.deepCopyTo(&cached_bitmap_, new_bitmap.config());
}
-bool CachingBitmapCanvasLayerTextureUpdater::pixelsDidChange() const
+bool CachingBitmapCanvasLayerUpdater::pixelsDidChange() const
{
return pixels_did_change_;
}
diff --git a/cc/caching_bitmap_canvas_layer_texture_updater.h b/cc/caching_bitmap_canvas_layer_updater.h
index 48be15ca..bd48683 100644
--- a/cc/caching_bitmap_canvas_layer_texture_updater.h
+++ b/cc/caching_bitmap_canvas_layer_updater.h
@@ -2,18 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CACHING_BITMAP_CANVAS_LAYER_TEXTURE_UPDATER_H_
-#define CACHING_BITMAP_CANVAS_LAYER_TEXTURE_UPDATER_H_
+#ifndef CACHING_BITMAP_CANVAS_LAYER_UPDATER_H_
+#define CACHING_BITMAP_CANVAS_LAYER_UPDATER_H_
#include "base/compiler_specific.h"
-#include "cc/bitmap_canvas_layer_texture_updater.h"
+#include "cc/bitmap_canvas_layer_updater.h"
namespace cc {
-class CachingBitmapCanvasLayerTextureUpdater
- : public BitmapCanvasLayerTextureUpdater {
+class CachingBitmapCanvasLayerUpdater
+ : public BitmapCanvasLayerUpdater {
public:
- static scoped_refptr<CachingBitmapCanvasLayerTextureUpdater> Create(
+ static scoped_refptr<CachingBitmapCanvasLayerUpdater> Create(
scoped_ptr<LayerPainter>);
virtual void prepareToUpdate(const IntRect& content_rect,
@@ -26,9 +26,9 @@ class CachingBitmapCanvasLayerTextureUpdater
bool pixelsDidChange() const;
private:
- explicit CachingBitmapCanvasLayerTextureUpdater(
+ explicit CachingBitmapCanvasLayerUpdater(
scoped_ptr<LayerPainter> painter);
- virtual ~CachingBitmapCanvasLayerTextureUpdater();
+ virtual ~CachingBitmapCanvasLayerUpdater();
bool pixels_did_change_;
SkBitmap cached_bitmap_;
@@ -36,4 +36,4 @@ class CachingBitmapCanvasLayerTextureUpdater
} // namespace cc
-#endif // CACHING_BITMAP_CANVAS_LAYER_TEXTURE_UPDATER_H_
+#endif // CACHING_BITMAP_CANVAS_LAYER_UPDATER_H_
diff --git a/cc/canvas_layer_texture_updater.cc b/cc/canvas_layer_updater.cc
index 923b897..96f6b7f 100644
--- a/cc/canvas_layer_texture_updater.cc
+++ b/cc/canvas_layer_updater.cc
@@ -4,7 +4,7 @@
#include "config.h"
-#include "cc/canvas_layer_texture_updater.h"
+#include "cc/canvas_layer_updater.h"
#include "FloatRect.h"
#include "SkiaUtils.h"
@@ -18,18 +18,18 @@
namespace cc {
-CanvasLayerTextureUpdater::CanvasLayerTextureUpdater(scoped_ptr<LayerPainter> painter)
+CanvasLayerUpdater::CanvasLayerUpdater(scoped_ptr<LayerPainter> painter)
: m_painter(painter.Pass())
{
}
-CanvasLayerTextureUpdater::~CanvasLayerTextureUpdater()
+CanvasLayerUpdater::~CanvasLayerUpdater()
{
}
-void CanvasLayerTextureUpdater::paintContents(SkCanvas* canvas, const IntRect& contentRect, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, RenderingStats& stats)
+void CanvasLayerUpdater::paintContents(SkCanvas* canvas, const IntRect& contentRect, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, RenderingStats& stats)
{
- TRACE_EVENT0("cc", "CanvasLayerTextureUpdater::paintContents");
+ TRACE_EVENT0("cc", "CanvasLayerUpdater::paintContents");
canvas->save();
canvas->translate(FloatToSkScalar(-contentRect.x()), FloatToSkScalar(-contentRect.y()));
diff --git a/cc/canvas_layer_texture_updater.h b/cc/canvas_layer_updater.h
index 09da606..7af78ef 100644
--- a/cc/canvas_layer_texture_updater.h
+++ b/cc/canvas_layer_updater.h
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CanvasLayerTextureUpdater_h
-#define CanvasLayerTextureUpdater_h
+#ifndef CanvasLayerUpdater_h
+#define CanvasLayerUpdater_h
-#include "cc/layer_texture_updater.h"
+#include "cc/layer_updater.h"
class SkCanvas;
@@ -13,13 +13,13 @@ namespace cc {
class LayerPainter;
-// Base class for BitmapCanvasLayerTextureUpdater and
-// SkPictureCanvasLayerTextureUpdater that reduces code duplication between
+// Base class for BitmapCanvasLayerUpdater and
+// SkPictureCanvasLayerUpdater that reduces code duplication between
// their respective paintContents implementations.
-class CanvasLayerTextureUpdater : public LayerTextureUpdater {
+class CanvasLayerUpdater : public LayerUpdater {
protected:
- explicit CanvasLayerTextureUpdater(scoped_ptr<LayerPainter>);
- virtual ~CanvasLayerTextureUpdater();
+ explicit CanvasLayerUpdater(scoped_ptr<LayerPainter>);
+ virtual ~CanvasLayerUpdater();
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 // CanvasLayerTextureUpdater_h
+#endif // CanvasLayerUpdater_h
diff --git a/cc/cc.gyp b/cc/cc.gyp
index 2aa37de..1a13f3c 100644
--- a/cc/cc.gyp
+++ b/cc/cc.gyp
@@ -9,12 +9,12 @@
'scoped_ptr_deque.h',
'scoped_ptr_hash_map.h',
'scoped_ptr_vector.h',
- 'bitmap_canvas_layer_texture_updater.cc',
- 'bitmap_canvas_layer_texture_updater.h',
- 'bitmap_skpicture_canvas_layer_texture_updater.cc',
- 'bitmap_skpicture_canvas_layer_texture_updater.h',
- 'caching_bitmap_canvas_layer_texture_updater.cc',
- 'caching_bitmap_canvas_layer_texture_updater.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',
'active_animation.cc',
'CCActiveAnimation.h',
'CCAppendQuadsData.h',
@@ -170,8 +170,8 @@
'video_layer_impl.h',
'yuv_video_draw_quad.cc',
'yuv_video_draw_quad.h',
- 'canvas_layer_texture_updater.cc',
- 'canvas_layer_texture_updater.h',
+ 'canvas_layer_updater.cc',
+ 'canvas_layer_updater.h',
'content_layer.cc',
'content_layer.h',
'content_layer_client.h',
@@ -188,8 +188,8 @@
'layer.cc',
'layer.h',
'layer_painter.h',
- 'layer_texture_updater.cc',
- 'layer_texture_updater.h',
+ 'layer_updater.cc',
+ 'layer_updater.h',
'platform_color.h',
'program_binding.cc',
'program_binding.h',
@@ -201,8 +201,8 @@
'scrollbar_layer.h',
'shader.cc',
'shader.h',
- 'skpicture_canvas_layer_texture_updater.cc',
- 'skpicture_canvas_layer_texture_updater.h',
+ 'skpicture_canvas_layer_updater.cc',
+ 'skpicture_canvas_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 f60b3ec..a75ee93 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_texture_updater.h"
-#include "cc/bitmap_skpicture_canvas_layer_texture_updater.h"
+#include "cc/bitmap_canvas_layer_updater.h"
+#include "cc/bitmap_skpicture_canvas_layer_updater.h"
#include "cc/content_layer_client.h"
#include "cc/layer_painter.h"
#include "cc/layer_tree_host.h"
@@ -67,7 +67,7 @@ void ContentLayer::setTexturePriorities(const PriorityCalculator& priorityCalc)
void ContentLayer::update(TextureUpdateQueue& queue, const OcclusionTracker* occlusion, RenderingStats& stats)
{
- createTextureUpdaterIfNeeded();
+ createUpdaterIfNeeded();
TiledLayer::update(queue, occlusion, stats);
m_needsDisplay = false;
}
@@ -77,23 +77,23 @@ bool ContentLayer::needMoreUpdates()
return needsIdlePaint();
}
-LayerTextureUpdater* ContentLayer::textureUpdater() const
+LayerUpdater* ContentLayer::updater() const
{
- return m_textureUpdater.get();
+ return m_updater.get();
}
-void ContentLayer::createTextureUpdaterIfNeeded()
+void ContentLayer::createUpdaterIfNeeded()
{
- if (m_textureUpdater)
+ if (m_updater)
return;
scoped_ptr<LayerPainter> painter = ContentLayerPainter::create(m_client).PassAs<LayerPainter>();
if (layerTreeHost()->settings().acceleratePainting)
- m_textureUpdater = SkPictureCanvasLayerTextureUpdater::create(painter.Pass());
+ m_updater = SkPictureCanvasLayerUpdater::create(painter.Pass());
else if (Settings::perTilePaintingEnabled())
- m_textureUpdater = BitmapSkPictureCanvasLayerTextureUpdater::create(painter.Pass());
+ m_updater = BitmapSkPictureCanvasLayerUpdater::create(painter.Pass());
else
- m_textureUpdater = BitmapCanvasLayerTextureUpdater::create(painter.Pass());
- m_textureUpdater->setOpaque(contentsOpaque());
+ m_updater = BitmapCanvasLayerUpdater::create(painter.Pass());
+ m_updater->setOpaque(contentsOpaque());
GLenum textureFormat = layerTreeHost()->rendererCapabilities().bestTextureFormat;
setTextureFormat(textureFormat);
@@ -102,8 +102,8 @@ void ContentLayer::createTextureUpdaterIfNeeded()
void ContentLayer::setContentsOpaque(bool opaque)
{
Layer::setContentsOpaque(opaque);
- if (m_textureUpdater)
- m_textureUpdater->setOpaque(opaque);
+ if (m_updater)
+ m_updater->setOpaque(opaque);
}
}
diff --git a/cc/content_layer.h b/cc/content_layer.h
index 12cafa4..ff7dbc0 100644
--- a/cc/content_layer.h
+++ b/cc/content_layer.h
@@ -16,7 +16,7 @@ namespace cc {
class ContentLayerClient;
class FloatRect;
class IntRect;
-class LayerTextureUpdater;
+class LayerUpdater;
class ContentLayerPainter : public LayerPainter {
public:
@@ -51,11 +51,11 @@ protected:
virtual ~ContentLayer();
private:
- virtual LayerTextureUpdater* textureUpdater() const OVERRIDE;
- virtual void createTextureUpdaterIfNeeded() OVERRIDE;
+ virtual LayerUpdater* updater() const OVERRIDE;
+ virtual void createUpdaterIfNeeded() OVERRIDE;
ContentLayerClient* m_client;
- scoped_refptr<LayerTextureUpdater> m_textureUpdater;
+ scoped_refptr<LayerUpdater> m_updater;
};
}
diff --git a/cc/content_layer_unittest.cc b/cc/content_layer_unittest.cc
index ed7823a..6582690 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_texture_updater.h"
+#include "cc/bitmap_canvas_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<BitmapCanvasLayerTextureUpdater> updater = BitmapCanvasLayerTextureUpdater::create(ContentLayerPainter::create(&client).PassAs<LayerPainter>());
+ scoped_refptr<BitmapCanvasLayerUpdater> updater = BitmapCanvasLayerUpdater::create(ContentLayerPainter::create(&client).PassAs<LayerPainter>());
IntRect resultingOpaqueRect;
RenderingStats stats;
diff --git a/cc/image_layer.cc b/cc/image_layer.cc
index 1c6b133..1e37920 100644
--- a/cc/image_layer.cc
+++ b/cc/image_layer.cc
@@ -7,42 +7,42 @@
#include "cc/image_layer.h"
#include "base/compiler_specific.h"
-#include "cc/layer_texture_updater.h"
+#include "cc/layer_updater.h"
#include "cc/layer_tree_host.h"
#include "cc/texture_update_queue.h"
namespace cc {
-class ImageLayerTextureUpdater : public LayerTextureUpdater {
+class ImageLayerUpdater : public LayerUpdater {
public:
- class Texture : public LayerTextureUpdater::Texture {
+ class Texture : public LayerUpdater::Texture {
public:
- Texture(ImageLayerTextureUpdater* textureUpdater, scoped_ptr<PrioritizedTexture> texture)
- : LayerTextureUpdater::Texture(texture.Pass())
- , m_textureUpdater(textureUpdater)
+ Texture(ImageLayerUpdater* updater, scoped_ptr<PrioritizedTexture> texture)
+ : LayerUpdater::Texture(texture.Pass())
+ , m_updater(updater)
{
}
virtual void update(TextureUpdateQueue& queue, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE
{
- textureUpdater()->updateTexture(queue, texture(), sourceRect, destOffset, partialUpdate);
+ updater()->updateTexture(queue, texture(), sourceRect, destOffset, partialUpdate);
}
private:
- ImageLayerTextureUpdater* textureUpdater() { return m_textureUpdater; }
+ ImageLayerUpdater* updater() { return m_updater; }
- ImageLayerTextureUpdater* m_textureUpdater;
+ ImageLayerUpdater* m_updater;
};
- static scoped_refptr<ImageLayerTextureUpdater> create()
+ static scoped_refptr<ImageLayerUpdater> create()
{
- return make_scoped_refptr(new ImageLayerTextureUpdater());
+ return make_scoped_refptr(new ImageLayerUpdater());
}
- virtual scoped_ptr<LayerTextureUpdater::Texture> createTexture(
+ virtual scoped_ptr<LayerUpdater::Texture> createTexture(
PrioritizedTextureManager* manager) OVERRIDE
{
- return scoped_ptr<LayerTextureUpdater::Texture>(new Texture(this, PrioritizedTexture::create(manager)));
+ return scoped_ptr<LayerUpdater::Texture>(new Texture(this, PrioritizedTexture::create(manager)));
}
void updateTexture(TextureUpdateQueue& queue, PrioritizedTexture* texture, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate)
@@ -72,8 +72,8 @@ public:
}
private:
- ImageLayerTextureUpdater() { }
- virtual ~ImageLayerTextureUpdater() { }
+ ImageLayerUpdater() { }
+ virtual ~ImageLayerUpdater() { }
SkBitmap m_bitmap;
};
@@ -115,9 +115,9 @@ void ImageLayer::setTexturePriorities(const PriorityCalculator& priorityCalc)
void ImageLayer::update(TextureUpdateQueue& queue, const OcclusionTracker* occlusion, RenderingStats& stats)
{
- createTextureUpdaterIfNeeded();
+ createUpdaterIfNeeded();
if (m_needsDisplay) {
- m_textureUpdater->setBitmap(m_bitmap);
+ m_updater->setBitmap(m_bitmap);
updateTileSizeAndTilingOption();
invalidateContentRect(IntRect(IntPoint(), contentBounds()));
m_needsDisplay = false;
@@ -125,19 +125,19 @@ void ImageLayer::update(TextureUpdateQueue& queue, const OcclusionTracker* occlu
TiledLayer::update(queue, occlusion, stats);
}
-void ImageLayer::createTextureUpdaterIfNeeded()
+void ImageLayer::createUpdaterIfNeeded()
{
- if (m_textureUpdater)
+ if (m_updater)
return;
- m_textureUpdater = ImageLayerTextureUpdater::create();
+ m_updater = ImageLayerUpdater::create();
GLenum textureFormat = layerTreeHost()->rendererCapabilities().bestTextureFormat;
setTextureFormat(textureFormat);
}
-LayerTextureUpdater* ImageLayer::textureUpdater() const
+LayerUpdater* ImageLayer::updater() const
{
- return m_textureUpdater.get();
+ return m_updater.get();
}
IntSize ImageLayer::contentBounds() const
diff --git a/cc/image_layer.h b/cc/image_layer.h
index 833a278..b96df58 100644
--- a/cc/image_layer.h
+++ b/cc/image_layer.h
@@ -10,7 +10,7 @@
namespace cc {
-class ImageLayerTextureUpdater;
+class ImageLayerUpdater;
// A Layer that contains only an Image element.
class ImageLayer : public TiledLayer {
@@ -30,13 +30,13 @@ private:
void setTilingOption(TilingOption);
- virtual LayerTextureUpdater* textureUpdater() const OVERRIDE;
- virtual void createTextureUpdaterIfNeeded() OVERRIDE;
+ virtual LayerUpdater* updater() const OVERRIDE;
+ virtual void createUpdaterIfNeeded() OVERRIDE;
virtual IntSize contentBounds() const OVERRIDE;
SkBitmap m_bitmap;
- scoped_refptr<ImageLayerTextureUpdater> m_textureUpdater;
+ scoped_refptr<ImageLayerUpdater> m_updater;
};
} // namespace cc
diff --git a/cc/layer_texture_updater.cc b/cc/layer_updater.cc
index 38a1307..e0a4384 100644
--- a/cc/layer_texture_updater.cc
+++ b/cc/layer_updater.cc
@@ -4,16 +4,16 @@
#include "config.h"
-#include "cc/layer_texture_updater.h"
+#include "cc/layer_updater.h"
namespace cc {
-LayerTextureUpdater::Texture::Texture(scoped_ptr<PrioritizedTexture> texture)
+LayerUpdater::Texture::Texture(scoped_ptr<PrioritizedTexture> texture)
: m_texture(texture.Pass())
{
}
-LayerTextureUpdater::Texture::~Texture()
+LayerUpdater::Texture::~Texture()
{
}
diff --git a/cc/layer_texture_updater.h b/cc/layer_updater.h
index 89ef759..10bced3 100644
--- a/cc/layer_texture_updater.h
+++ b/cc/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 LayerTextureUpdater_h
-#define LayerTextureUpdater_h
+#ifndef LayerUpdater_h
+#define LayerUpdater_h
#include "base/memory/ref_counted.h"
#include "cc/prioritized_texture.h"
@@ -17,7 +17,7 @@ class TextureManager;
struct RenderingStats;
class TextureUpdateQueue;
-class LayerTextureUpdater : public base::RefCounted<LayerTextureUpdater> {
+class LayerUpdater : public base::RefCounted<LayerUpdater> {
public:
// Allows texture uploaders to store per-tile resources.
class Texture {
@@ -36,7 +36,7 @@ public:
scoped_ptr<PrioritizedTexture> m_texture;
};
- LayerTextureUpdater() { }
+ LayerUpdater() { }
virtual scoped_ptr<Texture> createTexture(PrioritizedTextureManager*) = 0;
// The |resultingOpaqueRect| gives back a region of the layer that was painted opaque. If the layer is marked opaque in the updater,
@@ -47,12 +47,12 @@ public:
virtual void setOpaque(bool) { }
protected:
- virtual ~LayerTextureUpdater() { }
+ virtual ~LayerUpdater() { }
private:
- friend class base::RefCounted<LayerTextureUpdater>;
+ friend class base::RefCounted<LayerUpdater>;
};
} // namespace cc
-#endif // LayerTextureUpdater_h
+#endif // LayerUpdater_h
diff --git a/cc/scrollbar_layer.cc b/cc/scrollbar_layer.cc
index a9625e8..829ace9 100644
--- a/cc/scrollbar_layer.cc
+++ b/cc/scrollbar_layer.cc
@@ -186,30 +186,30 @@ void ScrollbarLayer::setLayerTreeHost(LayerTreeHost* host)
Layer::setLayerTreeHost(host);
}
-void ScrollbarLayer::createTextureUpdaterIfNeeded()
+void ScrollbarLayer::createUpdaterIfNeeded()
{
m_textureFormat = layerTreeHost()->rendererCapabilities().bestTextureFormat;
if (!m_backTrackUpdater)
- m_backTrackUpdater = CachingBitmapCanvasLayerTextureUpdater::Create(ScrollbarBackgroundPainter::create(m_scrollbar.get(), m_painter, m_geometry.get(), WebKit::WebScrollbar::BackTrackPart).PassAs<LayerPainter>());
+ m_backTrackUpdater = CachingBitmapCanvasLayerUpdater::Create(ScrollbarBackgroundPainter::create(m_scrollbar.get(), m_painter, m_geometry.get(), WebKit::WebScrollbar::BackTrackPart).PassAs<LayerPainter>());
if (!m_backTrack)
m_backTrack = m_backTrackUpdater->createTexture(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 = CachingBitmapCanvasLayerTextureUpdater::Create(ScrollbarBackgroundPainter::create(m_scrollbar.get(), m_painter, m_geometry.get(), WebKit::WebScrollbar::ForwardTrackPart).PassAs<LayerPainter>());
+ m_foreTrackUpdater = CachingBitmapCanvasLayerUpdater::Create(ScrollbarBackgroundPainter::create(m_scrollbar.get(), m_painter, m_geometry.get(), WebKit::WebScrollbar::ForwardTrackPart).PassAs<LayerPainter>());
if (!m_foreTrack)
m_foreTrack = m_foreTrackUpdater->createTexture(layerTreeHost()->contentsTextureManager());
}
if (!m_thumbUpdater)
- m_thumbUpdater = CachingBitmapCanvasLayerTextureUpdater::Create(ScrollbarThumbPainter::create(m_scrollbar.get(), m_painter, m_geometry.get()).PassAs<LayerPainter>());
+ m_thumbUpdater = CachingBitmapCanvasLayerUpdater::Create(ScrollbarThumbPainter::create(m_scrollbar.get(), m_painter, m_geometry.get()).PassAs<LayerPainter>());
if (!m_thumb)
m_thumb = m_thumbUpdater->createTexture(layerTreeHost()->contentsTextureManager());
}
-void ScrollbarLayer::updatePart(CachingBitmapCanvasLayerTextureUpdater* painter, LayerTextureUpdater::Texture* texture, const IntRect& rect, TextureUpdateQueue& queue, RenderingStats& stats)
+void ScrollbarLayer::updatePart(CachingBitmapCanvasLayerUpdater* painter, LayerUpdater::Texture* texture, const IntRect& rect, TextureUpdateQueue& queue, RenderingStats& stats)
{
// Skip painting and uploading if there are no invalidations and
// we already have valid texture data.
@@ -243,7 +243,7 @@ void ScrollbarLayer::setTexturePriorities(const PriorityCalculator&)
if (contentBounds().isEmpty())
return;
- createTextureUpdaterIfNeeded();
+ createUpdaterIfNeeded();
bool drawsToRoot = !renderTarget()->parent();
if (m_backTrack) {
@@ -266,7 +266,7 @@ void ScrollbarLayer::update(TextureUpdateQueue& queue, const OcclusionTracker*,
if (contentBounds().isEmpty())
return;
- createTextureUpdaterIfNeeded();
+ createUpdaterIfNeeded();
IntPoint scrollbarOrigin(m_scrollbar->location().x, m_scrollbar->location().y);
IntRect contentRect = layerRectToContentRect(WebKit::WebRect(scrollbarOrigin.x(), scrollbarOrigin.y(), bounds().width(), bounds().height()));
diff --git a/cc/scrollbar_layer.h b/cc/scrollbar_layer.h
index 370dca1..8be2d82 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_texture_updater.h"
+#include "caching_bitmap_canvas_layer_updater.h"
#include "cc/layer.h"
#include <public/WebScrollbar.h>
#include <public/WebScrollbarThemeGeometry.h>
@@ -42,8 +42,8 @@ protected:
virtual ~ScrollbarLayer();
private:
- void updatePart(CachingBitmapCanvasLayerTextureUpdater*, LayerTextureUpdater::Texture*, const IntRect&, TextureUpdateQueue&, RenderingStats&);
- void createTextureUpdaterIfNeeded();
+ void updatePart(CachingBitmapCanvasLayerUpdater*, LayerUpdater::Texture*, const IntRect&, TextureUpdateQueue&, RenderingStats&);
+ void createUpdaterIfNeeded();
scoped_ptr<WebKit::WebScrollbar> m_scrollbar;
WebKit::WebScrollbarThemePainter m_painter;
@@ -52,14 +52,14 @@ private:
GLenum m_textureFormat;
- scoped_refptr<CachingBitmapCanvasLayerTextureUpdater> m_backTrackUpdater;
- scoped_refptr<CachingBitmapCanvasLayerTextureUpdater> m_foreTrackUpdater;
- scoped_refptr<CachingBitmapCanvasLayerTextureUpdater> m_thumbUpdater;
+ scoped_refptr<CachingBitmapCanvasLayerUpdater> m_backTrackUpdater;
+ scoped_refptr<CachingBitmapCanvasLayerUpdater> m_foreTrackUpdater;
+ scoped_refptr<CachingBitmapCanvasLayerUpdater> m_thumbUpdater;
// All the parts of the scrollbar except the thumb
- scoped_ptr<LayerTextureUpdater::Texture> m_backTrack;
- scoped_ptr<LayerTextureUpdater::Texture> m_foreTrack;
- scoped_ptr<LayerTextureUpdater::Texture> m_thumb;
+ scoped_ptr<LayerUpdater::Texture> m_backTrack;
+ scoped_ptr<LayerUpdater::Texture> m_foreTrack;
+ scoped_ptr<LayerUpdater::Texture> m_thumb;
};
}
diff --git a/cc/skpicture_canvas_layer_texture_updater.cc b/cc/skpicture_canvas_layer_texture_updater.cc
deleted file mode 100644
index 1bb20df..0000000
--- a/cc/skpicture_canvas_layer_texture_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_texture_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 {
-
-SkPictureCanvasLayerTextureUpdater::Texture::Texture(SkPictureCanvasLayerTextureUpdater* textureUpdater, scoped_ptr<PrioritizedTexture> texture)
- : LayerTextureUpdater::Texture(texture.Pass())
- , m_textureUpdater(textureUpdater)
-{
-}
-
-SkPictureCanvasLayerTextureUpdater::Texture::~Texture()
-{
-}
-
-void SkPictureCanvasLayerTextureUpdater::Texture::update(TextureUpdateQueue& queue, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&)
-{
- textureUpdater()->updateTexture(queue, texture(), sourceRect, destOffset, partialUpdate);
-}
-
-SkPictureCanvasLayerTextureUpdater::SkPictureCanvasLayerTextureUpdater(scoped_ptr<LayerPainter> painter)
- : CanvasLayerTextureUpdater(painter.Pass())
- , m_layerIsOpaque(false)
-{
-}
-
-SkPictureCanvasLayerTextureUpdater::~SkPictureCanvasLayerTextureUpdater()
-{
-}
-
-scoped_refptr<SkPictureCanvasLayerTextureUpdater> SkPictureCanvasLayerTextureUpdater::create(scoped_ptr<LayerPainter> painter)
-{
- return make_scoped_refptr(new SkPictureCanvasLayerTextureUpdater(painter.Pass()));
-}
-
-scoped_ptr<LayerTextureUpdater::Texture> SkPictureCanvasLayerTextureUpdater::createTexture(PrioritizedTextureManager* manager)
-{
- return scoped_ptr<LayerTextureUpdater::Texture>(new Texture(this, PrioritizedTexture::create(manager)));
-}
-
-void SkPictureCanvasLayerTextureUpdater::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 SkPictureCanvasLayerTextureUpdater::drawPicture(SkCanvas* canvas)
-{
- TRACE_EVENT0("cc", "SkPictureCanvasLayerTextureUpdater::drawPicture");
- canvas->drawPicture(m_picture);
-}
-
-void SkPictureCanvasLayerTextureUpdater::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 SkPictureCanvasLayerTextureUpdater::setOpaque(bool opaque)
-{
- m_layerIsOpaque = opaque;
-}
-
-} // namespace cc
diff --git a/cc/skpicture_canvas_layer_updater.cc b/cc/skpicture_canvas_layer_updater.cc
new file mode 100644
index 0000000..fe42362
--- /dev/null
+++ b/cc/skpicture_canvas_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_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::Texture::Texture(SkPictureCanvasLayerUpdater* updater, scoped_ptr<PrioritizedTexture> texture)
+ : LayerUpdater::Texture(texture.Pass())
+ , m_updater(updater)
+{
+}
+
+SkPictureCanvasLayerUpdater::Texture::~Texture()
+{
+}
+
+void SkPictureCanvasLayerUpdater::Texture::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::Texture> SkPictureCanvasLayerUpdater::createTexture(PrioritizedTextureManager* manager)
+{
+ return scoped_ptr<LayerUpdater::Texture>(new Texture(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_canvas_layer_texture_updater.h b/cc/skpicture_canvas_layer_updater.h
index 42709cb..5fe8e1a 100644
--- a/cc/skpicture_canvas_layer_texture_updater.h
+++ b/cc/skpicture_canvas_layer_updater.h
@@ -3,10 +3,10 @@
// found in the LICENSE file.
-#ifndef SkPictureCanvasLayerTextureUpdater_h
-#define SkPictureCanvasLayerTextureUpdater_h
+#ifndef SkPictureCanvasLayerUpdater_h
+#define SkPictureCanvasLayerUpdater_h
-#include "cc/canvas_layer_texture_updater.h"
+#include "cc/canvas_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 BitmapSkPictureCanvasLayerTextureUpdater and
-// FrameBufferSkPictureCanvasLayerTextureUpdater are two examples of such
+// The BitmapSkPictureCanvasLayerUpdater and
+// FrameBufferSkPictureCanvasLayerUpdater are two examples of such
// implementations.
-class SkPictureCanvasLayerTextureUpdater : public CanvasLayerTextureUpdater {
+class SkPictureCanvasLayerUpdater : public CanvasLayerUpdater {
public:
- class Texture : public LayerTextureUpdater::Texture {
+ class Texture : public LayerUpdater::Texture {
public:
- Texture(SkPictureCanvasLayerTextureUpdater*, scoped_ptr<PrioritizedTexture>);
+ Texture(SkPictureCanvasLayerUpdater*, scoped_ptr<PrioritizedTexture>);
virtual ~Texture();
virtual void update(TextureUpdateQueue&, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE;
private:
- SkPictureCanvasLayerTextureUpdater* textureUpdater() { return m_textureUpdater; }
+ SkPictureCanvasLayerUpdater* updater() { return m_updater; }
- SkPictureCanvasLayerTextureUpdater* m_textureUpdater;
+ SkPictureCanvasLayerUpdater* m_updater;
};
- static scoped_refptr<SkPictureCanvasLayerTextureUpdater> create(scoped_ptr<LayerPainter>);
+ static scoped_refptr<SkPictureCanvasLayerUpdater> create(scoped_ptr<LayerPainter>);
- virtual scoped_ptr<LayerTextureUpdater::Texture> createTexture(PrioritizedTextureManager*) OVERRIDE;
+ virtual scoped_ptr<LayerUpdater::Texture> createTexture(PrioritizedTextureManager*) OVERRIDE;
virtual void setOpaque(bool) OVERRIDE;
protected:
- explicit SkPictureCanvasLayerTextureUpdater(scoped_ptr<LayerPainter>);
- virtual ~SkPictureCanvasLayerTextureUpdater();
+ explicit SkPictureCanvasLayerUpdater(scoped_ptr<LayerPainter>);
+ virtual ~SkPictureCanvasLayerUpdater();
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 // SkPictureCanvasLayerTextureUpdater_h
+#endif // SkPictureCanvasLayerUpdater_h
diff --git a/cc/test/tiled_layer_test_common.cc b/cc/test/tiled_layer_test_common.cc
index ad9ef2e..3467e22 100644
--- a/cc/test/tiled_layer_test_common.cc
+++ b/cc/test/tiled_layer_test_common.cc
@@ -10,19 +10,19 @@ using namespace cc;
namespace WebKitTests {
-FakeLayerTextureUpdater::Texture::Texture(FakeLayerTextureUpdater* layer, scoped_ptr<PrioritizedTexture> texture)
- : LayerTextureUpdater::Texture(texture.Pass())
+FakeLayerUpdater::Texture::Texture(FakeLayerUpdater* layer, scoped_ptr<PrioritizedTexture> texture)
+ : LayerUpdater::Texture(texture.Pass())
, m_layer(layer)
{
m_bitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10);
m_bitmap.allocPixels();
}
-FakeLayerTextureUpdater::Texture::~Texture()
+FakeLayerUpdater::Texture::~Texture()
{
}
-void FakeLayerTextureUpdater::Texture::update(TextureUpdateQueue& queue, const IntRect&, const IntSize&, bool partialUpdate, RenderingStats&)
+void FakeLayerUpdater::Texture::update(TextureUpdateQueue& queue, const IntRect&, const IntSize&, bool partialUpdate, RenderingStats&)
{
const IntRect rect(0, 0, 10, 10);
ResourceUpdate upload = ResourceUpdate::Create(
@@ -35,17 +35,17 @@ void FakeLayerTextureUpdater::Texture::update(TextureUpdateQueue& queue, const I
m_layer->update();
}
-FakeLayerTextureUpdater::FakeLayerTextureUpdater()
+FakeLayerUpdater::FakeLayerUpdater()
: m_prepareCount(0)
, m_updateCount(0)
{
}
-FakeLayerTextureUpdater::~FakeLayerTextureUpdater()
+FakeLayerUpdater::~FakeLayerUpdater()
{
}
-void FakeLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float, float, IntRect& resultingOpaqueRect, RenderingStats&)
+void FakeLayerUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float, float, IntRect& resultingOpaqueRect, RenderingStats&)
{
m_prepareCount++;
m_lastUpdateRect = contentRect;
@@ -57,15 +57,15 @@ void FakeLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const
resultingOpaqueRect = m_opaquePaintRect;
}
-void FakeLayerTextureUpdater::setRectToInvalidate(const IntRect& rect, FakeTiledLayer* layer)
+void FakeLayerUpdater::setRectToInvalidate(const IntRect& rect, FakeTiledLayer* layer)
{
m_rectToInvalidate = rect;
m_layer = layer;
}
-scoped_ptr<LayerTextureUpdater::Texture> FakeLayerTextureUpdater::createTexture(PrioritizedTextureManager* manager)
+scoped_ptr<LayerUpdater::Texture> FakeLayerUpdater::createTexture(PrioritizedTextureManager* manager)
{
- return scoped_ptr<LayerTextureUpdater::Texture>(new Texture(this, PrioritizedTexture::create(manager)));
+ return scoped_ptr<LayerUpdater::Texture>(new Texture(this, PrioritizedTexture::create(manager)));
}
FakeTiledLayerImpl::FakeTiledLayerImpl(int id)
@@ -79,7 +79,7 @@ FakeTiledLayerImpl::~FakeTiledLayerImpl()
FakeTiledLayer::FakeTiledLayer(PrioritizedTextureManager* textureManager)
: TiledLayer()
- , m_fakeTextureUpdater(make_scoped_refptr(new FakeLayerTextureUpdater))
+ , m_fakeUpdater(make_scoped_refptr(new FakeLayerUpdater))
, m_textureManager(textureManager)
{
setTileSize(tileSize());
@@ -129,9 +129,9 @@ cc::PrioritizedTextureManager* FakeTiledLayer::textureManager() const
return m_textureManager;
}
-cc::LayerTextureUpdater* FakeTiledLayer::textureUpdater() const
+cc::LayerUpdater* FakeTiledLayer::updater() const
{
- return m_fakeTextureUpdater.get();
+ return m_fakeUpdater.get();
}
cc::IntSize FakeTiledLayerWithScaledBounds::contentBounds() const
diff --git a/cc/test/tiled_layer_test_common.h b/cc/test/tiled_layer_test_common.h
index be52ca1..ee6d31d 100644
--- a/cc/test/tiled_layer_test_common.h
+++ b/cc/test/tiled_layer_test_common.h
@@ -9,7 +9,7 @@
#include "IntRect.h"
#include "IntSize.h"
#include "Region.h"
-#include "cc/layer_texture_updater.h"
+#include "cc/layer_updater.h"
#include "cc/prioritized_texture.h"
#include "cc/resource_provider.h"
#include "cc/texture_copier.h"
@@ -22,23 +22,23 @@ namespace WebKitTests {
class FakeTiledLayer;
-class FakeLayerTextureUpdater : public cc::LayerTextureUpdater {
+class FakeLayerUpdater : public cc::LayerUpdater {
public:
- class Texture : public cc::LayerTextureUpdater::Texture {
+ class Texture : public cc::LayerUpdater::Texture {
public:
- Texture(FakeLayerTextureUpdater*, scoped_ptr<cc::PrioritizedTexture>);
+ Texture(FakeLayerUpdater*, scoped_ptr<cc::PrioritizedTexture>);
virtual ~Texture();
virtual void update(cc::TextureUpdateQueue&, const cc::IntRect&, const cc::IntSize&, bool, cc::RenderingStats&) OVERRIDE;
private:
- FakeLayerTextureUpdater* m_layer;
+ FakeLayerUpdater* m_layer;
SkBitmap m_bitmap;
};
- FakeLayerTextureUpdater();
+ FakeLayerUpdater();
- virtual scoped_ptr<cc::LayerTextureUpdater::Texture> createTexture(cc::PrioritizedTextureManager*) OVERRIDE;
+ virtual scoped_ptr<cc::LayerUpdater::Texture> createTexture(cc::PrioritizedTextureManager*) OVERRIDE;
virtual void prepareToUpdate(const cc::IntRect& contentRect, const cc::IntSize&, float, float, cc::IntRect& resultingOpaqueRect, cc::RenderingStats&) OVERRIDE;
// Sets the rect to invalidate during the next call to prepareToUpdate(). After the next
@@ -59,7 +59,7 @@ public:
void setOpaquePaintRect(const cc::IntRect& opaquePaintRect) { m_opaquePaintRect = opaquePaintRect; }
protected:
- virtual ~FakeLayerTextureUpdater();
+ virtual ~FakeLayerUpdater();
private:
int m_prepareCount;
@@ -97,16 +97,16 @@ public:
virtual void setTexturePriorities(const cc::PriorityCalculator&) OVERRIDE;
virtual cc::PrioritizedTextureManager* textureManager() const OVERRIDE;
- FakeLayerTextureUpdater* fakeLayerTextureUpdater() { return m_fakeTextureUpdater.get(); }
+ FakeLayerUpdater* fakeLayerUpdater() { return m_fakeUpdater.get(); }
cc::FloatRect updateRect() { return m_updateRect; }
protected:
- virtual cc::LayerTextureUpdater* textureUpdater() const OVERRIDE;
- virtual void createTextureUpdaterIfNeeded() OVERRIDE { }
+ virtual cc::LayerUpdater* updater() const OVERRIDE;
+ virtual void createUpdaterIfNeeded() OVERRIDE { }
virtual ~FakeTiledLayer();
private:
- scoped_refptr<FakeLayerTextureUpdater> m_fakeTextureUpdater;
+ scoped_refptr<FakeLayerUpdater> m_fakeUpdater;
cc::PrioritizedTextureManager* m_textureManager;
cc::FloatRect m_lastNeedsDisplayRect;
};
diff --git a/cc/tiled_layer.cc b/cc/tiled_layer.cc
index fe3e3dd..367ca04 100644
--- a/cc/tiled_layer.cc
+++ b/cc/tiled_layer.cc
@@ -21,12 +21,12 @@ namespace cc {
class UpdatableTile : public LayerTilingData::Tile {
public:
- static scoped_ptr<UpdatableTile> create(scoped_ptr<LayerTextureUpdater::Texture> texture)
+ static scoped_ptr<UpdatableTile> create(scoped_ptr<LayerUpdater::Texture> texture)
{
return make_scoped_ptr(new UpdatableTile(texture.Pass()));
}
- LayerTextureUpdater::Texture* texture() { return m_texture.get(); }
+ LayerUpdater::Texture* texture() { return m_texture.get(); }
PrioritizedTexture* managedTexture() { return m_texture->texture(); }
bool isDirty() const { return !dirtyRect.isEmpty(); }
@@ -61,7 +61,7 @@ public:
bool isInUseOnImpl;
private:
- explicit UpdatableTile(scoped_ptr<LayerTextureUpdater::Texture> texture)
+ explicit UpdatableTile(scoped_ptr<LayerUpdater::Texture> texture)
: partialUpdate(false)
, validForFrame(false)
, occluded(false)
@@ -70,7 +70,7 @@ private:
{
}
- scoped_ptr<LayerTextureUpdater::Texture> m_texture;
+ scoped_ptr<LayerUpdater::Texture> m_texture;
DISALLOW_COPY_AND_ASSIGN(UpdatableTile);
};
@@ -255,9 +255,9 @@ UpdatableTile* TiledLayer::tileAt(int i, int j) const
UpdatableTile* TiledLayer::createTile(int i, int j)
{
- createTextureUpdaterIfNeeded();
+ createUpdaterIfNeeded();
- scoped_ptr<UpdatableTile> tile(UpdatableTile::create(textureUpdater()->createTexture(textureManager())));
+ scoped_ptr<UpdatableTile> tile(UpdatableTile::create(updater()->createTexture(textureManager())));
tile->managedTexture()->setDimensions(m_tiler->tileSize(), m_textureFormat);
UpdatableTile* addedTile = tile.get();
@@ -343,7 +343,7 @@ bool TiledLayer::tileNeedsBufferedUpdate(UpdatableTile* tile)
bool TiledLayer::updateTiles(int left, int top, int right, int bottom, TextureUpdateQueue& queue, const OcclusionTracker* occlusion, RenderingStats& stats, bool& didPaint)
{
didPaint = false;
- createTextureUpdaterIfNeeded();
+ createUpdaterIfNeeded();
bool ignoreOcclusions = !occlusion;
if (!haveTexturesForTiles(left, top, right, bottom, ignoreOcclusions)) {
@@ -457,9 +457,9 @@ void TiledLayer::updateTileTextures(const IntRect& paintRect, int left, int top,
// effect of disabling compositing, which causes our reference to the texture updater to be deleted.
// However, we can't free the memory backing the SkCanvas until the paint finishes,
// so we grab a local reference here to hold the updater alive until the paint completes.
- scoped_refptr<LayerTextureUpdater> protector(textureUpdater());
+ scoped_refptr<LayerUpdater> protector(updater());
IntRect paintedOpaqueRect;
- textureUpdater()->prepareToUpdate(paintRect, m_tiler->tileSize(), 1 / widthScale, 1 / heightScale, paintedOpaqueRect, stats);
+ updater()->prepareToUpdate(paintRect, m_tiler->tileSize(), 1 / widthScale, 1 / heightScale, paintedOpaqueRect, stats);
for (int j = top; j <= bottom; ++j) {
for (int i = left; i <= right; ++i) {
@@ -616,7 +616,7 @@ void TiledLayer::setTexturePriorities(const PriorityCalculator& priorityCalc)
IntRect tileRect = m_tiler->tileRect(tile);
tile->dirtyRect = tileRect;
- LayerTextureUpdater::Texture* backBuffer = tile->texture();
+ LayerUpdater::Texture* backBuffer = tile->texture();
setPriorityForTexture(visibleContentRect(), tile->dirtyRect, drawsToRoot, smallAnimatedLayer, backBuffer->texture());
scoped_ptr<PrioritizedTexture> frontBuffer = PrioritizedTexture::create(backBuffer->texture()->textureManager(),
backBuffer->texture()->size(),
diff --git a/cc/tiled_layer.h b/cc/tiled_layer.h
index b060ef6..0712c5f 100644
--- a/cc/tiled_layer.h
+++ b/cc/tiled_layer.h
@@ -6,7 +6,7 @@
#define TiledLayerChromium_h
#include "cc/layer.h"
-#include "cc/layer_texture_updater.h"
+#include "cc/layer_updater.h"
#include "cc/layer_tiling_data.h"
namespace cc {
@@ -50,8 +50,8 @@ protected:
void setBorderTexelOption(LayerTilingData::BorderTexelOption);
size_t numPaintedTiles() { return m_tiler->tiles().size(); }
- virtual LayerTextureUpdater* textureUpdater() const = 0;
- virtual void createTextureUpdaterIfNeeded() = 0;
+ virtual LayerUpdater* updater() const = 0;
+ virtual void createUpdaterIfNeeded() = 0;
// Set invalidations to be potentially repainted during update().
void invalidateContentRect(const IntRect& contentRect);
diff --git a/cc/tiled_layer_unittest.cc b/cc/tiled_layer_unittest.cc
index 3e79fab..8f46bb0 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_texture_updater.h"
+#include "cc/bitmap_canvas_layer_updater.h"
#include "cc/layer_painter.h"
#include "cc/overdraw_metrics.h"
#include "cc/rendering_stats.h"
@@ -381,7 +381,7 @@ TEST_F(TiledLayerTest, pushTilesMarkedDirtyDuringPaint)
// The tile size is 100x100, so this invalidates and then paints two tiles.
// However, during the paint, we invalidate one of the tiles. This should
// not prevent the tile from being pushed.
- layer->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer.get());
+ layer->fakeLayerUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer.get());
layer->setBounds(IntSize(100, 200));
layer->setVisibleContentRect(IntRect(0, 0, 100, 200));
updateAndPush(layer.get(), layerImpl.get());
@@ -399,7 +399,7 @@ TEST_F(TiledLayerTest, pushTilesLayerMarkedDirtyDuringPaintOnNextLayer)
ScopedFakeTiledLayerImpl layer2Impl(2);
// Invalidate a tile on layer1, during update of layer 2.
- layer2->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer1.get());
+ layer2->fakeLayerUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer1.get());
layer1->setBounds(IntSize(100, 200));
layer1->setVisibleContentRect(IntRect(0, 0, 100, 200));
layer2->setBounds(IntSize(100, 200));
@@ -421,7 +421,7 @@ TEST_F(TiledLayerTest, pushTilesLayerMarkedDirtyDuringPaintOnPreviousLayer)
ScopedFakeTiledLayerImpl layer1Impl(1);
ScopedFakeTiledLayerImpl layer2Impl(2);
- layer1->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer2.get());
+ layer1->fakeLayerUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer2.get());
layer1->setBounds(IntSize(100, 200));
layer1->setVisibleContentRect(IntRect(0, 0, 100, 200));
layer2->setBounds(IntSize(100, 200));
@@ -592,23 +592,23 @@ TEST_F(TiledLayerTest, invalidateFromPrepare)
EXPECT_TRUE(layerImpl->hasResourceIdForTileAt(0, 0));
EXPECT_TRUE(layerImpl->hasResourceIdForTileAt(0, 1));
- layer->fakeLayerTextureUpdater()->clearPrepareCount();
+ layer->fakeLayerUpdater()->clearPrepareCount();
// Invoke update again. As the layer is valid update shouldn't be invoked on
- // the LayerTextureUpdater.
+ // the LayerUpdater.
updateAndPush(layer.get(), layerImpl.get());
- EXPECT_EQ(0, layer->fakeLayerTextureUpdater()->prepareCount());
+ EXPECT_EQ(0, layer->fakeLayerUpdater()->prepareCount());
// setRectToInvalidate triggers invalidateContentRect() being invoked from update.
- layer->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(25, 25, 50, 50), layer.get());
- layer->fakeLayerTextureUpdater()->clearPrepareCount();
+ layer->fakeLayerUpdater()->setRectToInvalidate(IntRect(25, 25, 50, 50), layer.get());
+ layer->fakeLayerUpdater()->clearPrepareCount();
layer->invalidateContentRect(IntRect(0, 0, 50, 50));
updateAndPush(layer.get(), layerImpl.get());
- EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount());
- layer->fakeLayerTextureUpdater()->clearPrepareCount();
+ EXPECT_EQ(1, layer->fakeLayerUpdater()->prepareCount());
+ layer->fakeLayerUpdater()->clearPrepareCount();
// The layer should still be invalid as update invoked invalidate.
updateAndPush(layer.get(), layerImpl.get()); // visible
- EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount());
+ EXPECT_EQ(1, layer->fakeLayerUpdater()->prepareCount());
}
TEST_F(TiledLayerTest, verifyUpdateRectWhenContentBoundsAreScaled)
@@ -813,9 +813,9 @@ TEST_F(TiledLayerTest, partialUpdates)
EXPECT_EQ(6, m_queue->fullUploadSize());
EXPECT_EQ(0, m_queue->partialUploadSize());
updateTextures();
- EXPECT_EQ(6, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(6, layer->fakeLayerUpdater()->updateCount());
EXPECT_FALSE(m_queue->hasMoreUpdates());
- layer->fakeLayerTextureUpdater()->clearUpdateCount();
+ layer->fakeLayerUpdater()->clearUpdateCount();
layerPushPropertiesTo(layer.get(), layerImpl.get());
}
layerTreeHost->commitComplete();
@@ -828,9 +828,9 @@ TEST_F(TiledLayerTest, partialUpdates)
EXPECT_EQ(3, m_queue->fullUploadSize());
EXPECT_EQ(3, m_queue->partialUploadSize());
updateTextures();
- EXPECT_EQ(6, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(6, layer->fakeLayerUpdater()->updateCount());
EXPECT_FALSE(m_queue->hasMoreUpdates());
- layer->fakeLayerTextureUpdater()->clearUpdateCount();
+ layer->fakeLayerUpdater()->clearUpdateCount();
layerPushPropertiesTo(layer.get(), layerImpl.get());
}
layerTreeHost->commitComplete();
@@ -843,9 +843,9 @@ TEST_F(TiledLayerTest, partialUpdates)
EXPECT_EQ(2, m_queue->fullUploadSize());
EXPECT_EQ(4, m_queue->partialUploadSize());
updateTextures();
- EXPECT_EQ(6, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(6, layer->fakeLayerUpdater()->updateCount());
EXPECT_FALSE(m_queue->hasMoreUpdates());
- layer->fakeLayerTextureUpdater()->clearUpdateCount();
+ layer->fakeLayerUpdater()->clearUpdateCount();
layerPushPropertiesTo(layer.get(), layerImpl.get());
}
layerTreeHost->commitComplete();
@@ -866,9 +866,9 @@ TEST_F(TiledLayerTest, partialUpdates)
EXPECT_EQ(6, m_queue->fullUploadSize());
EXPECT_EQ(0, m_queue->partialUploadSize());
updateTextures();
- EXPECT_EQ(6, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(6, layer->fakeLayerUpdater()->updateCount());
EXPECT_FALSE(m_queue->hasMoreUpdates());
- layer->fakeLayerTextureUpdater()->clearUpdateCount();
+ layer->fakeLayerUpdater()->clearUpdateCount();
layerPushPropertiesTo(layer.get(), layerImpl.get());
}
layerTreeHost->commitComplete();
@@ -881,9 +881,9 @@ TEST_F(TiledLayerTest, partialUpdates)
EXPECT_EQ(0, m_queue->fullUploadSize());
EXPECT_EQ(4, m_queue->partialUploadSize());
updateTextures();
- EXPECT_EQ(4, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(4, layer->fakeLayerUpdater()->updateCount());
EXPECT_FALSE(m_queue->hasMoreUpdates());
- layer->fakeLayerTextureUpdater()->clearUpdateCount();
+ layer->fakeLayerUpdater()->clearUpdateCount();
layerPushPropertiesTo(layer.get(), layerImpl.get());
}
layerTreeHost->commitComplete();
@@ -905,7 +905,7 @@ TEST_F(TiledLayerTest, tilesPaintedWithoutOcclusion)
layer->setTexturePriorities(m_priorityCalculator);
m_textureManager->prioritizeTextures();
layer->update(*m_queue.get(), 0, m_stats);
- EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(2, layer->fakeLayerUpdater()->updateCount());
}
TEST_F(TiledLayerTest, tilesPaintedWithOcclusion)
@@ -925,33 +925,33 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusion)
layer->setTexturePriorities(m_priorityCalculator);
m_textureManager->prioritizeTextures();
layer->update(*m_queue.get(), &occluded, m_stats);
- EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(36-3, layer->fakeLayerUpdater()->updateCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 330000, 1);
EXPECT_EQ(3, occluded.overdrawMetrics().tilesCulledForUpload());
- layer->fakeLayerTextureUpdater()->clearUpdateCount();
+ layer->fakeLayerUpdater()->clearUpdateCount();
layer->setTexturePriorities(m_priorityCalculator);
m_textureManager->prioritizeTextures();
occluded.setOcclusion(IntRect(250, 200, 300, 100));
layer->invalidateContentRect(IntRect(0, 0, 600, 600));
layer->update(*m_queue.get(), &occluded, m_stats);
- EXPECT_EQ(36-2, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(36-2, layer->fakeLayerUpdater()->updateCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 330000 + 340000, 1);
EXPECT_EQ(3 + 2, occluded.overdrawMetrics().tilesCulledForUpload());
- layer->fakeLayerTextureUpdater()->clearUpdateCount();
+ layer->fakeLayerUpdater()->clearUpdateCount();
layer->setTexturePriorities(m_priorityCalculator);
m_textureManager->prioritizeTextures();
occluded.setOcclusion(IntRect(250, 250, 300, 100));
layer->invalidateContentRect(IntRect(0, 0, 600, 600));
layer->update(*m_queue.get(), &occluded, m_stats);
- EXPECT_EQ(36, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(36, layer->fakeLayerUpdater()->updateCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 330000 + 340000 + 360000, 1);
@@ -976,13 +976,13 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusionAndVisiblityConstraints)
layer->setTexturePriorities(m_priorityCalculator);
m_textureManager->prioritizeTextures();
layer->update(*m_queue.get(), &occluded, m_stats);
- EXPECT_EQ(24-3, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(24-3, layer->fakeLayerUpdater()->updateCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 210000, 1);
EXPECT_EQ(3, occluded.overdrawMetrics().tilesCulledForUpload());
- layer->fakeLayerTextureUpdater()->clearUpdateCount();
+ layer->fakeLayerUpdater()->clearUpdateCount();
// Now the visible region stops at the edge of the occlusion so the partly visible tiles become fully occluded.
occluded.setOcclusion(IntRect(200, 200, 300, 150));
@@ -992,13 +992,13 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusionAndVisiblityConstraints)
layer->setTexturePriorities(m_priorityCalculator);
m_textureManager->prioritizeTextures();
layer->update(*m_queue.get(), &occluded, m_stats);
- EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(24-6, layer->fakeLayerUpdater()->updateCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 210000 + 180000, 1);
EXPECT_EQ(3 + 6, occluded.overdrawMetrics().tilesCulledForUpload());
- layer->fakeLayerTextureUpdater()->clearUpdateCount();
+ layer->fakeLayerUpdater()->clearUpdateCount();
// Now the visible region is even smaller than the occlusion, it should have the same result.
occluded.setOcclusion(IntRect(200, 200, 300, 150));
@@ -1008,7 +1008,7 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusionAndVisiblityConstraints)
layer->setTexturePriorities(m_priorityCalculator);
m_textureManager->prioritizeTextures();
layer->update(*m_queue.get(), &occluded, m_stats);
- EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(24-6, layer->fakeLayerUpdater()->updateCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 210000 + 180000 + 180000, 1);
@@ -1032,7 +1032,7 @@ TEST_F(TiledLayerTest, tilesNotPaintedWithoutInvalidation)
layer->setTexturePriorities(m_priorityCalculator);
m_textureManager->prioritizeTextures();
layer->update(*m_queue.get(), &occluded, m_stats);
- EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(36-3, layer->fakeLayerUpdater()->updateCount());
{
updateTextures();
}
@@ -1041,13 +1041,13 @@ TEST_F(TiledLayerTest, tilesNotPaintedWithoutInvalidation)
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 330000, 1);
EXPECT_EQ(3, occluded.overdrawMetrics().tilesCulledForUpload());
- layer->fakeLayerTextureUpdater()->clearUpdateCount();
+ layer->fakeLayerUpdater()->clearUpdateCount();
layer->setTexturePriorities(m_priorityCalculator);
m_textureManager->prioritizeTextures();
// Repaint without marking it dirty. The 3 culled tiles will be pre-painted now.
layer->update(*m_queue.get(), &occluded, m_stats);
- EXPECT_EQ(3, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(3, layer->fakeLayerUpdater()->updateCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 330000, 1);
@@ -1076,7 +1076,7 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusionAndTransforms)
layer->setTexturePriorities(m_priorityCalculator);
m_textureManager->prioritizeTextures();
layer->update(*m_queue.get(), &occluded, m_stats);
- EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(36-3, layer->fakeLayerUpdater()->updateCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 330000, 1);
@@ -1110,13 +1110,13 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusionAndScaling)
// The content is half the size of the layer (so the number of tiles is fewer).
// In this case, the content is 300x300, and since the tile size is 100, the
// number of tiles 3x3.
- EXPECT_EQ(9, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(9, layer->fakeLayerUpdater()->updateCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 90000, 1);
EXPECT_EQ(0, occluded.overdrawMetrics().tilesCulledForUpload());
- layer->fakeLayerTextureUpdater()->clearUpdateCount();
+ layer->fakeLayerUpdater()->clearUpdateCount();
// This makes sure the painting works when the content space is scaled to
// a different layer space. In this case the occluded region catches the
@@ -1128,13 +1128,13 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusionAndScaling)
layer->setTexturePriorities(m_priorityCalculator);
m_textureManager->prioritizeTextures();
layer->update(*m_queue.get(), &occluded, m_stats);
- EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(9-1, layer->fakeLayerUpdater()->updateCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 90000 + 80000, 1);
EXPECT_EQ(1, occluded.overdrawMetrics().tilesCulledForUpload());
- layer->fakeLayerTextureUpdater()->clearUpdateCount();
+ layer->fakeLayerUpdater()->clearUpdateCount();
// This makes sure content scaling and transforms work together.
WebTransformationMatrix screenTransform;
@@ -1149,7 +1149,7 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusionAndScaling)
layer->setTexturePriorities(m_priorityCalculator);
m_textureManager->prioritizeTextures();
layer->update(*m_queue.get(), &occluded, m_stats);
- EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(9-1, layer->fakeLayerUpdater()->updateCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 90000 + 80000 + 80000, 1);
@@ -1178,7 +1178,7 @@ TEST_F(TiledLayerTest, visibleContentOpaqueRegion)
m_textureManager->prioritizeTextures();
// If the layer doesn't paint opaque content, then the visibleContentOpaqueRegion should be empty.
- layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
+ layer->fakeLayerUpdater()->setOpaquePaintRect(IntRect());
layer->invalidateContentRect(contentBounds);
layer->update(*m_queue.get(), &occluded, m_stats);
opaqueContents = layer->visibleContentOpaqueRegion();
@@ -1191,7 +1191,7 @@ TEST_F(TiledLayerTest, visibleContentOpaqueRegion)
// visibleContentOpaqueRegion should match the visible part of what is painted opaque.
opaquePaintRect = IntRect(10, 10, 90, 190);
- layer->fakeLayerTextureUpdater()->setOpaquePaintRect(opaquePaintRect);
+ layer->fakeLayerUpdater()->setOpaquePaintRect(opaquePaintRect);
layer->invalidateContentRect(contentBounds);
layer->update(*m_queue.get(), &occluded, m_stats);
updateTextures();
@@ -1205,7 +1205,7 @@ TEST_F(TiledLayerTest, visibleContentOpaqueRegion)
EXPECT_EQ(0, occluded.overdrawMetrics().tilesCulledForUpload());
// If we paint again without invalidating, the same stuff should be opaque.
- layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
+ layer->fakeLayerUpdater()->setOpaquePaintRect(IntRect());
layer->update(*m_queue.get(), &occluded, m_stats);
updateTextures();
opaqueContents = layer->visibleContentOpaqueRegion();
@@ -1219,7 +1219,7 @@ TEST_F(TiledLayerTest, visibleContentOpaqueRegion)
// If we repaint a non-opaque part of the tile, then it shouldn't lose its opaque-ness. And other tiles should
// not be affected.
- layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
+ layer->fakeLayerUpdater()->setOpaquePaintRect(IntRect());
layer->invalidateContentRect(IntRect(0, 0, 1, 1));
layer->update(*m_queue.get(), &occluded, m_stats);
updateTextures();
@@ -1234,7 +1234,7 @@ TEST_F(TiledLayerTest, visibleContentOpaqueRegion)
// If we repaint an opaque part of the tile, then it should lose its opaque-ness. But other tiles should still
// not be affected.
- layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
+ layer->fakeLayerUpdater()->setOpaquePaintRect(IntRect());
layer->invalidateContentRect(IntRect(10, 10, 1, 1));
layer->update(*m_queue.get(), &occluded, m_stats);
updateTextures();
@@ -1270,7 +1270,7 @@ TEST_F(TiledLayerTest, pixelsPaintedMetrics)
m_textureManager->prioritizeTextures();
// Invalidates and paints the whole layer.
- layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
+ layer->fakeLayerUpdater()->setOpaquePaintRect(IntRect());
layer->invalidateContentRect(contentBounds);
layer->update(*m_queue.get(), &occluded, m_stats);
updateTextures();
@@ -1284,7 +1284,7 @@ TEST_F(TiledLayerTest, pixelsPaintedMetrics)
// Invalidates an area on the top and bottom tile, which will cause us to paint the tile in the middle,
// even though it is not dirty and will not be uploaded.
- layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
+ layer->fakeLayerUpdater()->setOpaquePaintRect(IntRect());
layer->invalidateContentRect(IntRect(0, 0, 1, 1));
layer->invalidateContentRect(IntRect(50, 200, 10, 10));
layer->update(*m_queue.get(), &occluded, m_stats);
@@ -1352,14 +1352,14 @@ TEST_F(TiledLayerTest, dontAllocateContentsWhenTargetSurfaceCantBeAllocated)
*m_queue.get(), std::numeric_limits<size_t>::max());
{
updateTextures();
- EXPECT_EQ(6, root->fakeLayerTextureUpdater()->updateCount());
- EXPECT_EQ(3, child->fakeLayerTextureUpdater()->updateCount());
- EXPECT_EQ(3, child2->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(6, root->fakeLayerUpdater()->updateCount());
+ EXPECT_EQ(3, child->fakeLayerUpdater()->updateCount());
+ EXPECT_EQ(3, child2->fakeLayerUpdater()->updateCount());
EXPECT_FALSE(m_queue->hasMoreUpdates());
- root->fakeLayerTextureUpdater()->clearUpdateCount();
- child->fakeLayerTextureUpdater()->clearUpdateCount();
- child2->fakeLayerTextureUpdater()->clearUpdateCount();
+ root->fakeLayerUpdater()->clearUpdateCount();
+ child->fakeLayerUpdater()->clearUpdateCount();
+ child2->fakeLayerUpdater()->clearUpdateCount();
ScopedFakeTiledLayerImpl rootImpl(root->id());
ScopedFakeTiledLayerImpl childImpl(child->id());
@@ -1387,14 +1387,14 @@ TEST_F(TiledLayerTest, dontAllocateContentsWhenTargetSurfaceCantBeAllocated)
*m_queue.get(), (3 * 2 + 3 * 1) * (100 * 100) * 4);
{
updateTextures();
- EXPECT_EQ(6, root->fakeLayerTextureUpdater()->updateCount());
- EXPECT_EQ(0, child->fakeLayerTextureUpdater()->updateCount());
- EXPECT_EQ(0, child2->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(6, root->fakeLayerUpdater()->updateCount());
+ EXPECT_EQ(0, child->fakeLayerUpdater()->updateCount());
+ EXPECT_EQ(0, child2->fakeLayerUpdater()->updateCount());
EXPECT_FALSE(m_queue->hasMoreUpdates());
- root->fakeLayerTextureUpdater()->clearUpdateCount();
- child->fakeLayerTextureUpdater()->clearUpdateCount();
- child2->fakeLayerTextureUpdater()->clearUpdateCount();
+ root->fakeLayerUpdater()->clearUpdateCount();
+ child->fakeLayerUpdater()->clearUpdateCount();
+ child2->fakeLayerUpdater()->clearUpdateCount();
ScopedFakeTiledLayerImpl rootImpl(root->id());
ScopedFakeTiledLayerImpl childImpl(child->id());
@@ -1423,14 +1423,14 @@ TEST_F(TiledLayerTest, dontAllocateContentsWhenTargetSurfaceCantBeAllocated)
*m_queue.get(), (3 * 1) * (100 * 100) * 4);
{
updateTextures();
- EXPECT_EQ(0, root->fakeLayerTextureUpdater()->updateCount());
- EXPECT_EQ(0, child->fakeLayerTextureUpdater()->updateCount());
- EXPECT_EQ(0, child2->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_EQ(0, root->fakeLayerUpdater()->updateCount());
+ EXPECT_EQ(0, child->fakeLayerUpdater()->updateCount());
+ EXPECT_EQ(0, child2->fakeLayerUpdater()->updateCount());
EXPECT_FALSE(m_queue->hasMoreUpdates());
- root->fakeLayerTextureUpdater()->clearUpdateCount();
- child->fakeLayerTextureUpdater()->clearUpdateCount();
- child2->fakeLayerTextureUpdater()->clearUpdateCount();
+ root->fakeLayerUpdater()->clearUpdateCount();
+ child->fakeLayerUpdater()->clearUpdateCount();
+ child2->fakeLayerUpdater()->clearUpdateCount();
ScopedFakeTiledLayerImpl rootImpl(root->id());
ScopedFakeTiledLayerImpl childImpl(child->id());
@@ -1477,7 +1477,7 @@ public:
{
scoped_ptr<TrackingLayerPainter> trackingLayerPainter(TrackingLayerPainter::create());
m_trackingLayerPainter = trackingLayerPainter.get();
- m_layerTextureUpdater = BitmapCanvasLayerTextureUpdater::create(trackingLayerPainter.PassAs<LayerPainter>());
+ m_layerUpdater = BitmapCanvasLayerUpdater::create(trackingLayerPainter.PassAs<LayerPainter>());
}
TrackingLayerPainter* trackingLayerPainter() const { return m_trackingLayerPainter; }
@@ -1485,11 +1485,11 @@ public:
protected:
virtual ~UpdateTrackingTiledLayer() { }
- virtual LayerTextureUpdater* textureUpdater() const OVERRIDE { return m_layerTextureUpdater.get(); }
+ virtual LayerUpdater* updater() const OVERRIDE { return m_layerUpdater.get(); }
private:
TrackingLayerPainter* m_trackingLayerPainter;
- scoped_refptr<BitmapCanvasLayerTextureUpdater> m_layerTextureUpdater;
+ scoped_refptr<BitmapCanvasLayerUpdater> m_layerUpdater;
};
TEST_F(TiledLayerTest, nonIntegerContentsScaleIsNotDistortedDuringPaint)