| 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 #ifndef UI_COMPOSITOR_PAINT_RECORDER_H_ | 5 #ifndef UI_COMPOSITOR_PAINT_RECORDER_H_ |
| 6 #define UI_COMPOSITOR_PAINT_RECORDER_H_ | 6 #define UI_COMPOSITOR_PAINT_RECORDER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "skia/ext/refptr.h" | 10 #include "skia/ext/refptr.h" |
| 11 #include "ui/compositor/compositor_export.h" | 11 #include "ui/compositor/compositor_export.h" |
| 12 #include "ui/gfx/canvas.h" |
| 12 | 13 |
| 13 namespace cc { | 14 namespace cc { |
| 14 class DisplayItemList; | 15 class DisplayItemList; |
| 15 } | 16 } |
| 16 | 17 |
| 17 namespace gfx { | 18 namespace gfx { |
| 18 class Canvas; | 19 class Canvas; |
| 19 } | 20 } |
| 20 | 21 |
| 21 class SkCanvas; | 22 class SkCanvas; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 35 // PaintRecorder is in use. | 36 // PaintRecorder is in use. |
| 36 PaintRecorder(const PaintContext& context, PaintCache* cache); | 37 PaintRecorder(const PaintContext& context, PaintCache* cache); |
| 37 explicit PaintRecorder(const PaintContext& context); | 38 explicit PaintRecorder(const PaintContext& context); |
| 38 ~PaintRecorder(); | 39 ~PaintRecorder(); |
| 39 | 40 |
| 40 // Gets a gfx::Canvas for painting into. | 41 // Gets a gfx::Canvas for painting into. |
| 41 gfx::Canvas* canvas() { return canvas_; } | 42 gfx::Canvas* canvas() { return canvas_; } |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 const PaintContext& context_; | 45 const PaintContext& context_; |
| 46 gfx::Canvas owned_canvas_; |
| 45 gfx::Canvas* canvas_; | 47 gfx::Canvas* canvas_; |
| 46 scoped_ptr<gfx::Canvas> owned_canvas_; | |
| 47 PaintCache* cache_; | 48 PaintCache* cache_; |
| 48 | 49 |
| 49 DISALLOW_COPY_AND_ASSIGN(PaintRecorder); | 50 DISALLOW_COPY_AND_ASSIGN(PaintRecorder); |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 } // namespace ui | 53 } // namespace ui |
| 53 | 54 |
| 54 #endif // UI_COMPOSITOR_PAINT_RECORDER_H_ | 55 #endif // UI_COMPOSITOR_PAINT_RECORDER_H_ |
| OLD | NEW |