| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ui/compositor/paint_context.h" | 5 #include "ui/compositor/paint_context.h" |
| 6 | 6 |
| 7 #include "third_party/skia/include/core/SkPictureRecorder.h" | 7 #include "skia/ext/cdl_picture_recorder.h" |
| 8 #include "ui/gfx/canvas.h" | 8 #include "ui/gfx/canvas.h" |
| 9 | 9 |
| 10 namespace ui { | 10 namespace ui { |
| 11 | 11 |
| 12 PaintContext::PaintContext(cc::DisplayItemList* list, | 12 PaintContext::PaintContext(cc::DisplayItemList* list, |
| 13 float device_scale_factor, | 13 float device_scale_factor, |
| 14 const gfx::Rect& invalidation) | 14 const gfx::Rect& invalidation) |
| 15 : list_(list), | 15 : list_(list), |
| 16 owned_recorder_(new SkPictureRecorder), | 16 owned_recorder_(new CdlPictureRecorder), |
| 17 recorder_(owned_recorder_.get()), | 17 recorder_(owned_recorder_.get()), |
| 18 device_scale_factor_(device_scale_factor), | 18 device_scale_factor_(device_scale_factor), |
| 19 invalidation_(invalidation) { | 19 invalidation_(invalidation) { |
| 20 #if DCHECK_IS_ON() | 20 #if DCHECK_IS_ON() |
| 21 root_visited_ = nullptr; | 21 root_visited_ = nullptr; |
| 22 inside_paint_recorder_ = false; | 22 inside_paint_recorder_ = false; |
| 23 #endif | 23 #endif |
| 24 } | 24 } |
| 25 | 25 |
| 26 PaintContext::PaintContext(const PaintContext& other, | 26 PaintContext::PaintContext(const PaintContext& other, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 57 gfx::Rect PaintContext::ToLayerSpaceBounds( | 57 gfx::Rect PaintContext::ToLayerSpaceBounds( |
| 58 const gfx::Size& size_in_context) const { | 58 const gfx::Size& size_in_context) const { |
| 59 return gfx::Rect(size_in_context) + offset_; | 59 return gfx::Rect(size_in_context) + offset_; |
| 60 } | 60 } |
| 61 | 61 |
| 62 gfx::Rect PaintContext::ToLayerSpaceRect(const gfx::Rect& rect) const { | 62 gfx::Rect PaintContext::ToLayerSpaceRect(const gfx::Rect& rect) const { |
| 63 return rect + offset_; | 63 return rect + offset_; |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace ui | 66 } // namespace ui |
| OLD | NEW |