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_CANVAS_PAINTER_H_ | 5 #ifndef UI_COMPOSITOR_CANVAS_PAINTER_H_ |
6 #define UI_COMPOSITOR_CANVAS_PAINTER_H_ | 6 #define UI_COMPOSITOR_CANVAS_PAINTER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "ui/compositor/compositor_export.h" | 10 #include "ui/compositor/compositor_export.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 // CanvasPainter, the context() can be used to do painting using the normal | 22 // CanvasPainter, the context() can be used to do painting using the normal |
23 // composited paint paths. When the painter is destroyed, any painting done | 23 // composited paint paths. When the painter is destroyed, any painting done |
24 // with the context() will be rastered into the provided output bitmap. | 24 // with the context() will be rastered into the provided output bitmap. |
25 // | 25 // |
26 // TODO(enne): rename this class to be PaintContextRasterizer or some such. | 26 // TODO(enne): rename this class to be PaintContextRasterizer or some such. |
27 class COMPOSITOR_EXPORT CanvasPainter { | 27 class COMPOSITOR_EXPORT CanvasPainter { |
28 public: | 28 public: |
29 CanvasPainter(SkBitmap* output, | 29 CanvasPainter(SkBitmap* output, |
30 const gfx::Size& paint_size, | 30 const gfx::Size& paint_size, |
31 float raster_scale, | 31 float raster_scale, |
32 SkColor clear_color); | 32 SkColor clear_color, |
| 33 bool is_pixel_canvas); |
33 ~CanvasPainter(); | 34 ~CanvasPainter(); |
34 | 35 |
35 const PaintContext& context() const { return context_; } | 36 const PaintContext& context() const { return context_; } |
36 | 37 |
37 private: | 38 private: |
38 SkBitmap* const output_; | 39 SkBitmap* const output_; |
39 const gfx::Size paint_size_; | 40 const gfx::Size paint_size_; |
40 const float raster_scale_; | 41 const float raster_scale_; |
41 const SkColor clear_color_; | 42 const SkColor clear_color_; |
42 scoped_refptr<cc::DisplayItemList> list_; | 43 scoped_refptr<cc::DisplayItemList> list_; |
43 PaintContext context_; | 44 PaintContext context_; |
44 | 45 |
45 DISALLOW_COPY_AND_ASSIGN(CanvasPainter); | 46 DISALLOW_COPY_AND_ASSIGN(CanvasPainter); |
46 }; | 47 }; |
47 | 48 |
48 } // namespace ui | 49 } // namespace ui |
49 | 50 |
50 #endif // UI_COMPOSITOR_CANVAS_PAINTER_H_ | 51 #endif // UI_COMPOSITOR_CANVAS_PAINTER_H_ |
OLD | NEW |