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/debug/trace_event.h" | 7 #include "base/debug/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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 void DisplayListRasterSource::RasterCommon(SkCanvas* canvas, | 92 void DisplayListRasterSource::RasterCommon(SkCanvas* canvas, |
93 SkDrawPictureCallback* callback, | 93 SkDrawPictureCallback* callback, |
94 const gfx::Rect& canvas_rect, | 94 const gfx::Rect& canvas_rect, |
95 float contents_scale, | 95 float contents_scale, |
96 bool is_analysis) const { | 96 bool is_analysis) const { |
97 canvas->translate(-canvas_rect.x(), -canvas_rect.y()); | 97 canvas->translate(-canvas_rect.x(), -canvas_rect.y()); |
98 gfx::Rect content_rect = | 98 gfx::Rect content_rect = |
99 gfx::ToEnclosingRect(gfx::ScaleRect(gfx::Rect(size_), contents_scale)); | 99 gfx::ToEnclosingRect(gfx::ScaleRect(gfx::Rect(size_), contents_scale)); |
100 content_rect.Intersect(canvas_rect); | 100 content_rect.Intersect(canvas_rect); |
101 | 101 |
102 canvas->clipRect(gfx::RectToSkRect(content_rect), SkRegion::kIntersect_Op); | 102 canvas->clipRect(gfx::RectToSkRect(content_rect)); |
103 | 103 |
104 DCHECK(display_list_.get()); | 104 DCHECK(display_list_.get()); |
105 display_list_->Raster(canvas, callback, contents_scale); | 105 display_list_->Raster(canvas, callback, contents_scale); |
106 } | 106 } |
107 | 107 |
108 skia::RefPtr<SkPicture> DisplayListRasterSource::GetFlattenedPicture() { | 108 skia::RefPtr<SkPicture> DisplayListRasterSource::GetFlattenedPicture() { |
109 TRACE_EVENT0("cc", "DisplayListRasterSource::GetFlattenedPicture"); | 109 TRACE_EVENT0("cc", "DisplayListRasterSource::GetFlattenedPicture"); |
110 | 110 |
111 gfx::Rect display_list_rect(size_); | 111 gfx::Rect display_list_rect(size_); |
112 SkPictureRecorder recorder; | 112 SkPictureRecorder recorder; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 void DisplayListRasterSource::DidBeginTracing() { | 199 void DisplayListRasterSource::DidBeginTracing() { |
200 if (display_list_.get()) | 200 if (display_list_.get()) |
201 display_list_->EmitTraceSnapshot(); | 201 display_list_->EmitTraceSnapshot(); |
202 } | 202 } |
203 | 203 |
204 bool DisplayListRasterSource::CanUseLCDText() const { | 204 bool DisplayListRasterSource::CanUseLCDText() const { |
205 return can_use_lcd_text_; | 205 return can_use_lcd_text_; |
206 } | 206 } |
207 | 207 |
208 } // namespace cc | 208 } // namespace cc |
OLD | NEW |