OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/recording_source.h" | 5 #include "cc/layers/recording_source.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 | 49 |
50 Region no_longer_exposed_region(old_recorded_viewport); | 50 Region no_longer_exposed_region(old_recorded_viewport); |
51 no_longer_exposed_region.Subtract(new_recorded_viewport); | 51 no_longer_exposed_region.Subtract(new_recorded_viewport); |
52 invalidation->Union(no_longer_exposed_region); | 52 invalidation->Union(no_longer_exposed_region); |
53 } | 53 } |
54 | 54 |
55 void RecordingSource::FinishDisplayItemListUpdate() { | 55 void RecordingSource::FinishDisplayItemListUpdate() { |
56 TRACE_EVENT0("cc", "RecordingSource::FinishDisplayItemListUpdate"); | 56 TRACE_EVENT0("cc", "RecordingSource::FinishDisplayItemListUpdate"); |
57 DetermineIfSolidColor(); | 57 DetermineIfSolidColor(); |
58 display_list_->EmitTraceSnapshot(); | 58 display_list_->EmitTraceSnapshot(); |
59 if (generate_discardable_images_metadata_) | |
vmpstr
2017/04/25 17:43:40
This is the only place this flag is used afaik. If
Khushal
2017/04/25 18:18:10
That was my plan. After rebasing on your patch.
| |
60 display_list_->GenerateDiscardableImagesMetadata(); | |
61 } | 59 } |
62 | 60 |
63 void RecordingSource::SetNeedsDisplayRect(const gfx::Rect& layer_rect) { | 61 void RecordingSource::SetNeedsDisplayRect(const gfx::Rect& layer_rect) { |
64 if (!layer_rect.IsEmpty()) { | 62 if (!layer_rect.IsEmpty()) { |
65 // Clamp invalidation to the layer bounds. | 63 // Clamp invalidation to the layer bounds. |
66 invalidation_.Union(gfx::IntersectRects(layer_rect, gfx::Rect(size_))); | 64 invalidation_.Union(gfx::IntersectRects(layer_rect, gfx::Rect(size_))); |
67 } | 65 } |
68 } | 66 } |
69 | 67 |
70 bool RecordingSource::UpdateAndExpandInvalidation( | 68 bool RecordingSource::UpdateAndExpandInvalidation( |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
154 | 152 |
155 TRACE_EVENT1("cc", "RecordingSource::DetermineIfSolidColor", "opcount", | 153 TRACE_EVENT1("cc", "RecordingSource::DetermineIfSolidColor", "opcount", |
156 display_list_->ApproximateOpCount()); | 154 display_list_->ApproximateOpCount()); |
157 gfx::Size layer_size = GetSize(); | 155 gfx::Size layer_size = GetSize(); |
158 skia::AnalysisCanvas canvas(layer_size.width(), layer_size.height()); | 156 skia::AnalysisCanvas canvas(layer_size.width(), layer_size.height()); |
159 display_list_->Raster(&canvas, nullptr, gfx::Rect(layer_size), 1.f); | 157 display_list_->Raster(&canvas, nullptr, gfx::Rect(layer_size), 1.f); |
160 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); | 158 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); |
161 } | 159 } |
162 | 160 |
163 } // namespace cc | 161 } // namespace cc |
OLD | NEW |