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/playback/display_list_raster_source.h" | 5 #include "cc/playback/display_list_raster_source.h" |
6 | 6 |
7 #include "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
8 #include "cc/base/region.h" | 8 #include "cc/base/region.h" |
9 #include "cc/debug/debug_colors.h" | 9 #include "cc/debug/debug_colors.h" |
10 #include "cc/playback/display_item_list.h" | 10 #include "cc/playback/display_item_list.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 157 |
158 layer_rect.Intersect(gfx::Rect(size_)); | 158 layer_rect.Intersect(gfx::Rect(size_)); |
159 skia::AnalysisCanvas canvas(layer_rect.width(), layer_rect.height()); | 159 skia::AnalysisCanvas canvas(layer_rect.width(), layer_rect.height()); |
160 RasterForAnalysis(&canvas, layer_rect, 1.0f); | 160 RasterForAnalysis(&canvas, layer_rect, 1.0f); |
161 analysis->is_solid_color = canvas.GetColorIfSolid(&analysis->solid_color); | 161 analysis->is_solid_color = canvas.GetColorIfSolid(&analysis->solid_color); |
162 } | 162 } |
163 | 163 |
164 void DisplayListRasterSource::GatherPixelRefs( | 164 void DisplayListRasterSource::GatherPixelRefs( |
165 const gfx::Rect& content_rect, | 165 const gfx::Rect& content_rect, |
166 float contents_scale, | 166 float contents_scale, |
167 std::vector<SkPixelRef*>* pixel_refs) const { | 167 std::vector<skia::PositionPixelRef>* pixel_refs) const { |
168 DCHECK_EQ(0u, pixel_refs->size()); | 168 DCHECK_EQ(0u, pixel_refs->size()); |
169 | 169 |
170 gfx::Rect layer_rect = | 170 gfx::Rect layer_rect = |
171 gfx::ScaleToEnclosingRect(content_rect, 1.0f / contents_scale); | 171 gfx::ScaleToEnclosingRect(content_rect, 1.0f / contents_scale); |
172 | 172 |
173 PixelRefMap::Iterator iterator(layer_rect, display_list_.get()); | 173 PixelRefMap::Iterator iterator(layer_rect, display_list_.get()); |
174 while (iterator) { | 174 while (iterator) { |
175 pixel_refs->push_back(*iterator); | 175 pixel_refs->push_back(*iterator); |
176 ++iterator; | 176 ++iterator; |
177 } | 177 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 } | 229 } |
230 | 230 |
231 scoped_refptr<RasterSource> DisplayListRasterSource::CreateCloneWithoutLCDText() | 231 scoped_refptr<RasterSource> DisplayListRasterSource::CreateCloneWithoutLCDText() |
232 const { | 232 const { |
233 bool can_use_lcd_text = false; | 233 bool can_use_lcd_text = false; |
234 return scoped_refptr<RasterSource>( | 234 return scoped_refptr<RasterSource>( |
235 new DisplayListRasterSource(this, can_use_lcd_text)); | 235 new DisplayListRasterSource(this, can_use_lcd_text)); |
236 } | 236 } |
237 | 237 |
238 } // namespace cc | 238 } // namespace cc |
OLD | NEW |