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

Side by Side Diff: cc/layers/content_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: Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « cc/layers/content_layer.h ('k') | cc/layers/delegated_renderer_layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layers/content_layer.h" 5 #include "cc/layers/content_layer.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "cc/layers/content_layer_client.h" 10 #include "cc/layers/content_layer_client.h"
(...skipping 27 matching lines...) Expand all
38 } 38 }
39 39
40 ContentLayer::ContentLayer(ContentLayerClient* client) 40 ContentLayer::ContentLayer(ContentLayerClient* client)
41 : TiledLayer(), 41 : TiledLayer(),
42 client_(client), 42 client_(client),
43 can_use_lcd_text_last_frame_(can_use_lcd_text()) { 43 can_use_lcd_text_last_frame_(can_use_lcd_text()) {
44 } 44 }
45 45
46 ContentLayer::~ContentLayer() {} 46 ContentLayer::~ContentLayer() {}
47 47
48 bool ContentLayer::DrawsContent() const { 48 void ContentLayer::ClearClient() {
49 return TiledLayer::DrawsContent() && client_; 49 client_ = NULL;
50 UpdateDrawsContent(HasDrawableContent());
51 }
52
53 bool ContentLayer::HasDrawableContent() const {
54 return client_ && TiledLayer::HasDrawableContent();
50 } 55 }
51 56
52 void ContentLayer::SetLayerTreeHost(LayerTreeHost* host) { 57 void ContentLayer::SetLayerTreeHost(LayerTreeHost* host) {
53 TiledLayer::SetLayerTreeHost(host); 58 TiledLayer::SetLayerTreeHost(host);
54 59
55 if (!updater_.get()) 60 if (!updater_.get())
56 return; 61 return;
57 62
58 if (host) { 63 if (host) {
59 updater_->set_rendering_stats_instrumentation( 64 updater_->set_rendering_stats_instrumentation(
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 return picture; 159 return picture;
155 } 160 }
156 161
157 void ContentLayer::OnOutputSurfaceCreated() { 162 void ContentLayer::OnOutputSurfaceCreated() {
158 SetTextureFormat( 163 SetTextureFormat(
159 layer_tree_host()->GetRendererCapabilities().best_texture_format); 164 layer_tree_host()->GetRendererCapabilities().best_texture_format);
160 TiledLayer::OnOutputSurfaceCreated(); 165 TiledLayer::OnOutputSurfaceCreated();
161 } 166 }
162 167
163 } // namespace cc 168 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/content_layer.h ('k') | cc/layers/delegated_renderer_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698