summaryrefslogtreecommitdiffstats
path: root/cc/layers/image_layer.cc
diff options
context:
space:
mode:
authorawoloszyn@chromium.org <awoloszyn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-11 17:39:54 +0000
committerawoloszyn@chromium.org <awoloszyn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-11 17:41:20 +0000
commitad63b2ffb295d0de395b83faeff6125475f0f5c4 (patch)
tree1d867e1db456fd4bb95f5e0a202e7005d5f6ae85 /cc/layers/image_layer.cc
parent6ebf79234c9c16a3611a05f481e845433ddd7271 (diff)
downloadchromium_src-ad63b2ffb295d0de395b83faeff6125475f0f5c4.zip
chromium_src-ad63b2ffb295d0de395b83faeff6125475f0f5c4.tar.gz
chromium_src-ad63b2ffb295d0de395b83faeff6125475f0f5c4.tar.bz2
Keeping track of descendants that draw content instead of recalcualting
This is a required for removing Render Surface creation from CalcDrawProps. BUG=386788 Review URL: https://codereview.chromium.org/373113003 Cr-Commit-Position: refs/heads/master@{#288740} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288740 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers/image_layer.cc')
-rw-r--r--cc/layers/image_layer.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/cc/layers/image_layer.cc b/cc/layers/image_layer.cc
index edcf1dc..67e620c 100644
--- a/cc/layers/image_layer.cc
+++ b/cc/layers/image_layer.cc
@@ -30,9 +30,14 @@ void ImageLayer::SetBitmap(const SkBitmap& bitmap) {
return;
bitmap_ = bitmap;
+ UpdateDrawsContent(HasDrawableContent());
SetNeedsDisplay();
}
+bool ImageLayer::HasDrawableContent() const {
+ return !bitmap_.isNull() && TiledLayer::HasDrawableContent();
+}
+
void ImageLayer::SetTexturePriorities(const PriorityCalculator& priority_calc) {
// Update the tile data before creating all the layer's tiles.
UpdateTileSizeAndTilingOption();
@@ -73,10 +78,6 @@ void ImageLayer::CalculateContentsScale(float ideal_contents_scale,
*content_bounds = gfx::Size(bitmap_.width(), bitmap_.height());
}
-bool ImageLayer::DrawsContent() const {
- return !bitmap_.isNull() && TiledLayer::DrawsContent();
-}
-
void ImageLayer::OnOutputSurfaceCreated() {
SetTextureFormat(
layer_tree_host()->GetRendererCapabilities().best_texture_format);