Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3093)

Unified Diff: cc/picture_image_layer.cc

Issue 12326022: Efficiently handle image layer scaling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win warnings Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/picture_image_layer.h ('k') | cc/picture_image_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/picture_image_layer.cc
diff --git a/cc/picture_image_layer.cc b/cc/picture_image_layer.cc
index 14864464ae12dc50ddc9d5e202e23c15dd08c3ba..4419decb63559e76eca5ca2c6a25bd4c51e2f5e6 100644
--- a/cc/picture_image_layer.cc
+++ b/cc/picture_image_layer.cc
@@ -4,6 +4,7 @@
#include "cc/picture_image_layer.h"
+#include "cc/picture_image_layer_impl.h"
#include "third_party/skia/include/core/SkCanvas.h"
namespace cc {
@@ -23,6 +24,15 @@ PictureImageLayer::~PictureImageLayer()
clearClient();
}
+scoped_ptr<LayerImpl> PictureImageLayer::createLayerImpl(
+ LayerTreeImpl* treeImpl) {
+ return PictureImageLayerImpl::create(treeImpl, id()).PassAs<LayerImpl>();
+}
+
+bool PictureImageLayer::drawsContent() const {
+ return !bitmap_.isNull() && PictureLayer::drawsContent();
+}
+
void PictureImageLayer::setBitmap(const SkBitmap& bitmap)
{
// setBitmap() currently gets called whenever there is any
@@ -36,21 +46,6 @@ void PictureImageLayer::setBitmap(const SkBitmap& bitmap)
setNeedsDisplay();
}
-void PictureImageLayer::update(
- ResourceUpdateQueue& queue,
- const OcclusionTracker* tracker,
- RenderingStats* stats) {
- if (bounds() != bounds_) {
- // Pictures are recorded in layer space, so if the layer size changes,
- // then the picture needs to be re-scaled, as a directly composited image
- // always fills its entire layer bounds. This could be improved by
- // recording pictures of images at their actual resolution somehow.
- bounds_ = bounds();
- setNeedsDisplay();
- }
- PictureLayer::update(queue, tracker, stats);
-}
-
void PictureImageLayer::paintContents(
SkCanvas* canvas,
const gfx::Rect& clip,
« no previous file with comments | « cc/picture_image_layer.h ('k') | cc/picture_image_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698