| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 if (clear_canvas_with_debug_color_) { | 166 if (clear_canvas_with_debug_color_) { |
| 167 // Any non-painted areas outside of the content bounds are left in | 167 // Any non-painted areas outside of the content bounds are left in |
| 168 // this color. If this is seen then it means that cc neglected to | 168 // this color. If this is seen then it means that cc neglected to |
| 169 // rerasterize a tile that used to intersect with the content rect | 169 // rerasterize a tile that used to intersect with the content rect |
| 170 // after the content bounds grew. | 170 // after the content bounds grew. |
| 171 canvas->save(); | 171 canvas->save(); |
| 172 // Use clipRegion to bypass CTM because the rects are device rects. | 172 // Use clipRegion to bypass CTM because the rects are device rects. |
| 173 SkRegion interest_region; | 173 SkRegion interest_region; |
| 174 interest_region.setRect(interest_rect); | 174 interest_region.setRect(interest_rect); |
| 175 canvas->clipRegion(interest_region, kDifference_SkClipOp); | 175 canvas->clipRegion(interest_region, SkClipOp::kDifference); |
| 176 canvas->clear(DebugColors::MissingResizeInvalidations()); | 176 canvas->clear(DebugColors::MissingResizeInvalidations()); |
| 177 canvas->restore(); | 177 canvas->restore(); |
| 178 } | 178 } |
| 179 | 179 |
| 180 // Drawing at most 2 x 2 x (canvas width + canvas height) texels is 2-3X | 180 // Drawing at most 2 x 2 x (canvas width + canvas height) texels is 2-3X |
| 181 // faster than clearing, so special case this. | 181 // faster than clearing, so special case this. |
| 182 canvas->save(); | 182 canvas->save(); |
| 183 // Use clipRegion to bypass CTM because the rects are device rects. | 183 // Use clipRegion to bypass CTM because the rects are device rects. |
| 184 SkRegion interest_region; | 184 SkRegion interest_region; |
| 185 interest_region.setRect(interest_rect); | 185 interest_region.setRect(interest_rect); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 bool can_use_lcd_text = false; | 303 bool can_use_lcd_text = false; |
| 304 return scoped_refptr<RasterSource>(new RasterSource(this, can_use_lcd_text)); | 304 return scoped_refptr<RasterSource>(new RasterSource(this, can_use_lcd_text)); |
| 305 } | 305 } |
| 306 | 306 |
| 307 RasterSource::PlaybackSettings::PlaybackSettings() | 307 RasterSource::PlaybackSettings::PlaybackSettings() |
| 308 : playback_to_shared_canvas(false), | 308 : playback_to_shared_canvas(false), |
| 309 skip_images(false), | 309 skip_images(false), |
| 310 use_image_hijack_canvas(true) {} | 310 use_image_hijack_canvas(true) {} |
| 311 | 311 |
| 312 } // namespace cc | 312 } // namespace cc |
| OLD | NEW |