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/resources/display_list_raster_source.h" | 5 #include "cc/resources/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/resources/display_item_list.h" | 10 #include "cc/resources/display_item_list.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 skia::RefPtr<SkPicture> DisplayListRasterSource::GetFlattenedPicture() { | 124 skia::RefPtr<SkPicture> DisplayListRasterSource::GetFlattenedPicture() { |
125 TRACE_EVENT0("cc", "DisplayListRasterSource::GetFlattenedPicture"); | 125 TRACE_EVENT0("cc", "DisplayListRasterSource::GetFlattenedPicture"); |
126 | 126 |
127 gfx::Rect display_list_rect(size_); | 127 gfx::Rect display_list_rect(size_); |
128 SkPictureRecorder recorder; | 128 SkPictureRecorder recorder; |
129 SkCanvas* canvas = recorder.beginRecording(display_list_rect.width(), | 129 SkCanvas* canvas = recorder.beginRecording(display_list_rect.width(), |
130 display_list_rect.height()); | 130 display_list_rect.height()); |
131 if (!display_list_rect.IsEmpty()) | 131 if (!display_list_rect.IsEmpty()) |
132 PlaybackToCanvas(canvas, display_list_rect, 1.0); | 132 PlaybackToCanvas(canvas, display_list_rect, 1.0); |
133 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording()); | 133 skia::RefPtr<SkPicture> picture = |
| 134 skia::AdoptRef(recorder.endRecordingAsPicture()); |
134 | 135 |
135 return picture; | 136 return picture; |
136 } | 137 } |
137 | 138 |
138 size_t DisplayListRasterSource::GetPictureMemoryUsage() const { | 139 size_t DisplayListRasterSource::GetPictureMemoryUsage() const { |
139 return display_list_->PictureMemoryUsage(); | 140 return display_list_->PictureMemoryUsage(); |
140 } | 141 } |
141 | 142 |
142 void DisplayListRasterSource::PerformSolidColorAnalysis( | 143 void DisplayListRasterSource::PerformSolidColorAnalysis( |
143 const gfx::Rect& content_rect, | 144 const gfx::Rect& content_rect, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 } | 224 } |
224 | 225 |
225 scoped_refptr<RasterSource> DisplayListRasterSource::CreateCloneWithoutLCDText() | 226 scoped_refptr<RasterSource> DisplayListRasterSource::CreateCloneWithoutLCDText() |
226 const { | 227 const { |
227 bool can_use_lcd_text = false; | 228 bool can_use_lcd_text = false; |
228 return scoped_refptr<RasterSource>( | 229 return scoped_refptr<RasterSource>( |
229 new DisplayListRasterSource(this, can_use_lcd_text)); | 230 new DisplayListRasterSource(this, can_use_lcd_text)); |
230 } | 231 } |
231 | 232 |
232 } // namespace cc | 233 } // namespace cc |
OLD | NEW |