| 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/raster_source.h" | 5 #include "cc/playback/raster_source.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 SkPictureRecorder recorder; | 210 SkPictureRecorder recorder; |
| 211 SkCanvas* canvas = recorder.beginRecording(size_.width(), size_.height()); | 211 SkCanvas* canvas = recorder.beginRecording(size_.width(), size_.height()); |
| 212 if (!size_.IsEmpty()) { | 212 if (!size_.IsEmpty()) { |
| 213 PrepareForPlaybackToCanvas(canvas); | 213 PrepareForPlaybackToCanvas(canvas); |
| 214 RasterCommon(canvas, nullptr); | 214 RasterCommon(canvas, nullptr); |
| 215 } | 215 } |
| 216 | 216 |
| 217 return recorder.finishRecordingAsPicture(); | 217 return recorder.finishRecordingAsPicture(); |
| 218 } | 218 } |
| 219 | 219 |
| 220 size_t RasterSource::GetPictureMemoryUsage() const { | 220 size_t RasterSource::GetMemoryUsage() const { |
| 221 if (!display_list_) | 221 if (!display_list_) |
| 222 return 0; | 222 return 0; |
| 223 return display_list_->ApproximateMemoryUsage() + | 223 return display_list_->ApproximateMemoryUsage() + |
| 224 painter_reported_memory_usage_; | 224 painter_reported_memory_usage_; |
| 225 } | 225 } |
| 226 | 226 |
| 227 bool RasterSource::PerformSolidColorAnalysis(const gfx::Rect& content_rect, | 227 bool RasterSource::PerformSolidColorAnalysis(const gfx::Rect& content_rect, |
| 228 float contents_scale, | 228 float contents_scale, |
| 229 SkColor* color) const { | 229 SkColor* color) const { |
| 230 TRACE_EVENT0("cc", "RasterSource::PerformSolidColorAnalysis"); | 230 TRACE_EVENT0("cc", "RasterSource::PerformSolidColorAnalysis"); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 bool can_use_lcd_text = false; | 306 bool can_use_lcd_text = false; |
| 307 return scoped_refptr<RasterSource>(new RasterSource(this, can_use_lcd_text)); | 307 return scoped_refptr<RasterSource>(new RasterSource(this, can_use_lcd_text)); |
| 308 } | 308 } |
| 309 | 309 |
| 310 RasterSource::PlaybackSettings::PlaybackSettings() | 310 RasterSource::PlaybackSettings::PlaybackSettings() |
| 311 : playback_to_shared_canvas(false), | 311 : playback_to_shared_canvas(false), |
| 312 skip_images(false), | 312 skip_images(false), |
| 313 use_image_hijack_canvas(true) {} | 313 use_image_hijack_canvas(true) {} |
| 314 | 314 |
| 315 } // namespace cc | 315 } // namespace cc |
| OLD | NEW |