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

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

Issue 16903005: Add layer name into frame viewer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase code Created 7 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
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 "cc/debug/benchmark_instrumentation.h" 7 #include "cc/debug/benchmark_instrumentation.h"
8 #include "cc/debug/devtools_instrumentation.h" 8 #include "cc/debug/devtools_instrumentation.h"
9 #include "cc/layers/picture_layer_impl.h" 9 #include "cc/layers/picture_layer_impl.h"
10 #include "cc/trees/layer_tree_impl.h" 10 #include "cc/trees/layer_tree_impl.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 void PictureLayer::SetNeedsDisplayRect(const gfx::RectF& layer_rect) { 62 void PictureLayer::SetNeedsDisplayRect(const gfx::RectF& layer_rect) {
63 gfx::Rect rect = gfx::ToEnclosedRect(layer_rect); 63 gfx::Rect rect = gfx::ToEnclosedRect(layer_rect);
64 if (!rect.IsEmpty()) { 64 if (!rect.IsEmpty()) {
65 // Clamp invalidation to the layer bounds. 65 // Clamp invalidation to the layer bounds.
66 rect.Intersect(gfx::Rect(bounds())); 66 rect.Intersect(gfx::Rect(bounds()));
67 pending_invalidation_.Union(rect); 67 pending_invalidation_.Union(rect);
68 } 68 }
69 Layer::SetNeedsDisplayRect(layer_rect); 69 Layer::SetNeedsDisplayRect(layer_rect);
70 } 70 }
71 71
72 bool PictureLayer::Update(ResourceUpdateQueue*, 72 bool PictureLayer::Update(ResourceUpdateQueue* queue,
73 const OcclusionTracker*) { 73 const OcclusionTracker* occlusion) {
74 // Do not early-out of this function so that PicturePile::Update has a chance 74 // Do not early-out of this function so that PicturePile::Update has a chance
75 // to record pictures due to changing visibility of this layer. 75 // to record pictures due to changing visibility of this layer.
76 76
77 TRACE_EVENT1(benchmark_instrumentation::kCategory, 77 TRACE_EVENT1(benchmark_instrumentation::kCategory,
78 benchmark_instrumentation::kPictureLayerUpdate, 78 benchmark_instrumentation::kPictureLayerUpdate,
79 benchmark_instrumentation::kSourceFrameNumber, 79 benchmark_instrumentation::kSourceFrameNumber,
80 layer_tree_host()->source_frame_number()); 80 layer_tree_host()->source_frame_number());
81 81
82 Layer::Update(queue, occlusion);
83
82 pile_->Resize(paint_properties().bounds); 84 pile_->Resize(paint_properties().bounds);
83 85
84 // Calling paint in WebKit can sometimes cause invalidations, so save 86 // Calling paint in WebKit can sometimes cause invalidations, so save
85 // off the invalidation prior to calling update. 87 // off the invalidation prior to calling update.
86 pending_invalidation_.Swap(&pile_invalidation_); 88 pending_invalidation_.Swap(&pile_invalidation_);
87 pending_invalidation_.Clear(); 89 pending_invalidation_.Clear();
88 90
89 gfx::Rect visible_layer_rect = gfx::ScaleToEnclosingRect( 91 gfx::Rect visible_layer_rect = gfx::ScaleToEnclosingRect(
90 visible_content_rect(), 1.f / contents_scale_x()); 92 visible_content_rect(), 1.f / contents_scale_x());
91 if (layer_tree_host()->settings().using_synchronous_renderer_compositor) { 93 if (layer_tree_host()->settings().using_synchronous_renderer_compositor) {
(...skipping 22 matching lines...) Expand all
114 116
115 void PictureLayer::SetIsMask(bool is_mask) { 117 void PictureLayer::SetIsMask(bool is_mask) {
116 is_mask_ = is_mask; 118 is_mask_ = is_mask;
117 } 119 }
118 120
119 bool PictureLayer::SupportsLCDText() const { 121 bool PictureLayer::SupportsLCDText() const {
120 return true; 122 return true;
121 } 123 }
122 124
123 } // namespace cc 125 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698