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

Unified Diff: cc/layers/image_layer.cc

Issue 373113003: Keeping track of descendants that draw content instead of recalcualting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made DrawsContent non-virtual Created 6 years, 5 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
Index: cc/layers/image_layer.cc
diff --git a/cc/layers/image_layer.cc b/cc/layers/image_layer.cc
index cada84df3ccb4a0ce63731db532f2e0cd1f08358..281d33fbefd0ecff676b5733ba594ef3b5f6b640 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(true);
SetNeedsDisplay();
}
+void ImageLayer::UpdateDrawsContent(bool drawsContent) {
danakj 2014/07/14 14:56:31 draws_content thoughout
awoloszyn 2014/07/14 19:38:32 Done.
+ TiledLayer::UpdateDrawsContent(drawsContent && !bitmap_.isNull());
danakj 2014/07/14 14:56:31 so I think what you're trying to do here, you want
awoloszyn 2014/07/14 15:25:09 So how I had set UpateDrawsContent up, currently,
+}
+
void ImageLayer::SetTexturePriorities(const PriorityCalculator& priority_calc) {
// Update the tile data before creating all the layer's tiles.
UpdateTileSizeAndTilingOption();
@@ -77,10 +82,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);

Powered by Google App Engine
This is Rietveld 408576698