| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 const gfx::Rect& canvas_rect, | 100 const gfx::Rect& canvas_rect, |
| 101 float contents_scale) const { | 101 float contents_scale) const { |
| 102 RasterSourceHelper::PrepareForPlaybackToCanvas( | 102 RasterSourceHelper::PrepareForPlaybackToCanvas( |
| 103 canvas, canvas_rect, gfx::Rect(size_), contents_scale, background_color_, | 103 canvas, canvas_rect, gfx::Rect(size_), contents_scale, background_color_, |
| 104 clear_canvas_with_debug_color_, requires_clear_); | 104 clear_canvas_with_debug_color_, requires_clear_); |
| 105 | 105 |
| 106 RasterCommon(canvas, NULL, canvas_rect, contents_scale); | 106 RasterCommon(canvas, NULL, canvas_rect, contents_scale); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void DisplayListRasterSource::RasterCommon(SkCanvas* canvas, | 109 void DisplayListRasterSource::RasterCommon(SkCanvas* canvas, |
| 110 SkDrawPictureCallback* callback, | 110 SkPicture::AbortCallback* callback, |
| 111 const gfx::Rect& canvas_rect, | 111 const gfx::Rect& canvas_rect, |
| 112 float contents_scale) const { | 112 float contents_scale) const { |
| 113 canvas->translate(-canvas_rect.x(), -canvas_rect.y()); | 113 canvas->translate(-canvas_rect.x(), -canvas_rect.y()); |
| 114 gfx::Rect content_rect = | 114 gfx::Rect content_rect = |
| 115 gfx::ToEnclosingRect(gfx::ScaleRect(gfx::Rect(size_), contents_scale)); | 115 gfx::ToEnclosingRect(gfx::ScaleRect(gfx::Rect(size_), contents_scale)); |
| 116 content_rect.Intersect(canvas_rect); | 116 content_rect.Intersect(canvas_rect); |
| 117 | 117 |
| 118 canvas->clipRect(gfx::RectToSkRect(content_rect), SkRegion::kIntersect_Op); | 118 canvas->clipRect(gfx::RectToSkRect(content_rect), SkRegion::kIntersect_Op); |
| 119 | 119 |
| 120 DCHECK(display_list_.get()); | 120 DCHECK(display_list_.get()); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 } | 226 } |
| 227 | 227 |
| 228 scoped_refptr<RasterSource> DisplayListRasterSource::CreateCloneWithoutLCDText() | 228 scoped_refptr<RasterSource> DisplayListRasterSource::CreateCloneWithoutLCDText() |
| 229 const { | 229 const { |
| 230 bool can_use_lcd_text = false; | 230 bool can_use_lcd_text = false; |
| 231 return scoped_refptr<RasterSource>( | 231 return scoped_refptr<RasterSource>( |
| 232 new DisplayListRasterSource(this, can_use_lcd_text)); | 232 new DisplayListRasterSource(this, can_use_lcd_text)); |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace cc | 235 } // namespace cc |
| OLD | NEW |