OLD | NEW |
---|---|
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 "base/auto_reset.h" |
8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
9 #include "cc/layers/content_layer_client.h" | 9 #include "cc/layers/content_layer_client.h" |
10 #include "cc/layers/picture_layer_impl.h" | 10 #include "cc/layers/picture_layer_impl.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 recording_source_->SetNeedsDisplayRect(layer_rect); | 96 recording_source_->SetNeedsDisplayRect(layer_rect); |
97 Layer::SetNeedsDisplayRect(layer_rect); | 97 Layer::SetNeedsDisplayRect(layer_rect); |
98 } | 98 } |
99 | 99 |
100 bool PictureLayer::Update() { | 100 bool PictureLayer::Update() { |
101 update_source_frame_number_ = layer_tree_host()->SourceFrameNumber(); | 101 update_source_frame_number_ = layer_tree_host()->SourceFrameNumber(); |
102 bool updated = Layer::Update(); | 102 bool updated = Layer::Update(); |
103 | 103 |
104 gfx::Size layer_size = paint_properties().bounds; | 104 gfx::Size layer_size = paint_properties().bounds; |
105 | 105 |
106 recording_source_->SetBackgroundColor(SafeOpaqueBackgroundColor()); | 106 // When transformed rasterization is used, we try to match the rendering |
enne (OOO)
2017/03/29 13:01:42
I'm not sure I agree with this. I think if a laye
trchen
2017/03/29 21:50:36
I thought layer opaqueness is more of a hint than
| |
107 // without a compositing layer, thus we don't over draw background to fill | |
108 // snapped edges. | |
109 SkColor background_color = ShouldUseTransformedRasterization() | |
110 ? SK_ColorTRANSPARENT | |
111 : SafeOpaqueBackgroundColor(); | |
112 recording_source_->SetBackgroundColor(background_color); | |
107 recording_source_->SetRequiresClear( | 113 recording_source_->SetRequiresClear( |
108 !contents_opaque() && | 114 !contents_opaque() && |
109 !picture_layer_inputs_.client->FillsBoundsCompletely()); | 115 !picture_layer_inputs_.client->FillsBoundsCompletely()); |
110 | 116 |
111 TRACE_EVENT1("cc", "PictureLayer::Update", "source_frame_number", | 117 TRACE_EVENT1("cc", "PictureLayer::Update", "source_frame_number", |
112 layer_tree_host()->SourceFrameNumber()); | 118 layer_tree_host()->SourceFrameNumber()); |
113 devtools_instrumentation::ScopedLayerTreeTask update_layer( | 119 devtools_instrumentation::ScopedLayerTreeTask update_layer( |
114 devtools_instrumentation::kUpdateLayer, id(), layer_tree_host()->GetId()); | 120 devtools_instrumentation::kUpdateLayer, id(), layer_tree_host()->GetId()); |
115 | 121 |
116 // UpdateAndExpandInvalidation will give us an invalidation that covers | 122 // UpdateAndExpandInvalidation will give us an invalidation that covers |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
268 return false; | 274 return false; |
269 | 275 |
270 return true; | 276 return true; |
271 } | 277 } |
272 | 278 |
273 const DisplayItemList* PictureLayer::GetDisplayItemList() { | 279 const DisplayItemList* PictureLayer::GetDisplayItemList() { |
274 return picture_layer_inputs_.display_list.get(); | 280 return picture_layer_inputs_.display_list.get(); |
275 } | 281 } |
276 | 282 |
277 } // namespace cc | 283 } // namespace cc |
OLD | NEW |