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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 } | 101 } |
102 | 102 |
103 void DisplayListRasterSource::RasterCommon( | 103 void DisplayListRasterSource::RasterCommon( |
104 SkCanvas* canvas, | 104 SkCanvas* canvas, |
105 SkPicture::AbortCallback* callback, | 105 SkPicture::AbortCallback* callback, |
106 const gfx::Rect& canvas_bitmap_rect, | 106 const gfx::Rect& canvas_bitmap_rect, |
107 const gfx::Rect& canvas_playback_rect, | 107 const gfx::Rect& canvas_playback_rect, |
108 float contents_scale) const { | 108 float contents_scale) const { |
109 canvas->translate(-canvas_bitmap_rect.x(), -canvas_bitmap_rect.y()); | 109 canvas->translate(-canvas_bitmap_rect.x(), -canvas_bitmap_rect.y()); |
110 gfx::Rect content_rect = | 110 gfx::Rect content_rect = |
111 gfx::ToEnclosingRect(gfx::ScaleRect(gfx::Rect(size_), contents_scale)); | 111 gfx::ScaleToEnclosingRect(gfx::Rect(size_), contents_scale); |
112 content_rect.Intersect(canvas_playback_rect); | 112 content_rect.Intersect(canvas_playback_rect); |
113 | 113 |
114 canvas->clipRect(gfx::RectToSkRect(content_rect), SkRegion::kIntersect_Op); | 114 canvas->clipRect(gfx::RectToSkRect(content_rect), SkRegion::kIntersect_Op); |
115 | 115 |
116 DCHECK(display_list_.get()); | 116 DCHECK(display_list_.get()); |
117 gfx::Rect canvas_target_playback_rect = | 117 gfx::Rect canvas_target_playback_rect = |
118 canvas_playback_rect - canvas_bitmap_rect.OffsetFromOrigin(); | 118 canvas_playback_rect - canvas_bitmap_rect.OffsetFromOrigin(); |
119 int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_); | 119 int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_); |
120 for (int i = 0; i < repeat_count; ++i) { | 120 for (int i = 0; i < repeat_count; ++i) { |
121 display_list_->Raster(canvas, callback, canvas_target_playback_rect, | 121 display_list_->Raster(canvas, callback, canvas_target_playback_rect, |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 } | 222 } |
223 | 223 |
224 scoped_refptr<RasterSource> DisplayListRasterSource::CreateCloneWithoutLCDText() | 224 scoped_refptr<RasterSource> DisplayListRasterSource::CreateCloneWithoutLCDText() |
225 const { | 225 const { |
226 bool can_use_lcd_text = false; | 226 bool can_use_lcd_text = false; |
227 return scoped_refptr<RasterSource>( | 227 return scoped_refptr<RasterSource>( |
228 new DisplayListRasterSource(this, can_use_lcd_text)); | 228 new DisplayListRasterSource(this, can_use_lcd_text)); |
229 } | 229 } |
230 | 230 |
231 } // namespace cc | 231 } // namespace cc |
OLD | NEW |