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

Side by Side Diff: cc/layers/picture_layer.cc

Issue 462803002: Fix failing (flaky) LayerTreeHostTestLCDNotification test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: flakylcd: reordertests 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/layers/texture_layer_unittest.cc » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/picture_layer.h" 5 #include "cc/layers/picture_layer.h"
6 6
7 #include "base/auto_reset.h"
7 #include "cc/layers/content_layer_client.h" 8 #include "cc/layers/content_layer_client.h"
8 #include "cc/layers/picture_layer_impl.h" 9 #include "cc/layers/picture_layer_impl.h"
9 #include "cc/trees/layer_tree_impl.h" 10 #include "cc/trees/layer_tree_impl.h"
10 #include "third_party/skia/include/core/SkPictureRecorder.h" 11 #include "third_party/skia/include/core/SkPictureRecorder.h"
11 #include "ui/gfx/rect_conversions.h" 12 #include "ui/gfx/rect_conversions.h"
12 13
13 namespace cc { 14 namespace cc {
14 15
15 scoped_refptr<PictureLayer> PictureLayer::Create(ContentLayerClient* client) { 16 scoped_refptr<PictureLayer> PictureLayer::Create(ContentLayerClient* client) {
16 return make_scoped_refptr(new PictureLayer(client)); 17 return make_scoped_refptr(new PictureLayer(client));
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 pending_invalidation_.Union(rect); 79 pending_invalidation_.Union(rect);
79 } 80 }
80 Layer::SetNeedsDisplayRect(layer_rect); 81 Layer::SetNeedsDisplayRect(layer_rect);
81 } 82 }
82 83
83 bool PictureLayer::Update(ResourceUpdateQueue* queue, 84 bool PictureLayer::Update(ResourceUpdateQueue* queue,
84 const OcclusionTracker<Layer>* occlusion) { 85 const OcclusionTracker<Layer>* occlusion) {
85 update_source_frame_number_ = layer_tree_host()->source_frame_number(); 86 update_source_frame_number_ = layer_tree_host()->source_frame_number();
86 bool updated = Layer::Update(queue, occlusion); 87 bool updated = Layer::Update(queue, occlusion);
87 88
88 UpdateCanUseLCDText(); 89 {
90 base::AutoReset<bool> ignore_set_needs_commit(&ignore_set_needs_commit_,
91 true);
92 UpdateCanUseLCDText();
93 }
89 94
90 gfx::Rect visible_layer_rect = gfx::ScaleToEnclosingRect( 95 gfx::Rect visible_layer_rect = gfx::ScaleToEnclosingRect(
91 visible_content_rect(), 1.f / contents_scale_x()); 96 visible_content_rect(), 1.f / contents_scale_x());
92 gfx::Size layer_size = paint_properties().bounds; 97 gfx::Size layer_size = paint_properties().bounds;
93 98
94 if (last_updated_visible_content_rect_ == visible_content_rect() && 99 if (last_updated_visible_content_rect_ == visible_content_rect() &&
95 pile_->tiling_size() == layer_size && pending_invalidation_.IsEmpty()) { 100 pile_->tiling_size() == layer_size && pending_invalidation_.IsEmpty()) {
96 // Only early out if the visible content rect of this layer hasn't changed. 101 // Only early out if the visible content rect of this layer hasn't changed.
97 return updated; 102 return updated;
98 } 103 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 208
204 bool PictureLayer::HasDrawableContent() const { 209 bool PictureLayer::HasDrawableContent() const {
205 return client_ && Layer::HasDrawableContent(); 210 return client_ && Layer::HasDrawableContent();
206 } 211 }
207 212
208 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { 213 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) {
209 benchmark->RunOnLayer(this); 214 benchmark->RunOnLayer(this);
210 } 215 }
211 216
212 } // namespace cc 217 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/texture_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698