OLD | NEW |
1 | 1 |
2 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #ifndef UI_GFX_CANVAS_PAINT_MAC_H_ | 6 #ifndef UI_GFX_CANVAS_PAINT_MAC_H_ |
7 #define UI_GFX_CANVAS_PAINT_MAC_H_ | 7 #define UI_GFX_CANVAS_PAINT_MAC_H_ |
8 | 8 |
9 #include "skia/ext/platform_canvas.h" | 9 #include "skia/ext/platform_canvas.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
11 | 11 |
12 #import <Cocoa/Cocoa.h> | 12 #import <Cocoa/Cocoa.h> |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 | 15 |
16 // A class designed to translate skia painting into a region to the current | 16 // A class designed to translate skia painting into a region to the current |
17 // graphics context. On construction, it will set up a context for painting | 17 // graphics context. On construction, it will set up a context for painting |
18 // into, and on destruction, it will commit it to the current context. | 18 // into, and on destruction, it will commit it to the current context. |
19 // Note: The created context is always inialized to (0, 0, 0, 0). | 19 // Note: The created context is always inialized to (0, 0, 0, 0). |
20 class UI_EXPORT CanvasSkiaPaint : public Canvas { | 20 class GFX_EXPORT CanvasSkiaPaint : public Canvas { |
21 public: | 21 public: |
22 // This constructor assumes the result is opaque. | 22 // This constructor assumes the result is opaque. |
23 explicit CanvasSkiaPaint(NSRect dirtyRect); | 23 explicit CanvasSkiaPaint(NSRect dirtyRect); |
24 CanvasSkiaPaint(NSRect dirtyRect, bool opaque); | 24 CanvasSkiaPaint(NSRect dirtyRect, bool opaque); |
25 virtual ~CanvasSkiaPaint(); | 25 virtual ~CanvasSkiaPaint(); |
26 | 26 |
27 // If true, the data painted into the CanvasSkiaPaint is blended onto the | 27 // If true, the data painted into the CanvasSkiaPaint is blended onto the |
28 // current context, else it is copied. | 28 // current context, else it is copied. |
29 void set_composite_alpha(bool composite_alpha) { | 29 void set_composite_alpha(bool composite_alpha) { |
30 composite_alpha_ = composite_alpha; | 30 composite_alpha_ = composite_alpha; |
(...skipping 19 matching lines...) Expand all Loading... |
50 | 50 |
51 // Disallow copy and assign. | 51 // Disallow copy and assign. |
52 CanvasSkiaPaint(const CanvasSkiaPaint&); | 52 CanvasSkiaPaint(const CanvasSkiaPaint&); |
53 CanvasSkiaPaint& operator=(const CanvasSkiaPaint&); | 53 CanvasSkiaPaint& operator=(const CanvasSkiaPaint&); |
54 }; | 54 }; |
55 | 55 |
56 } // namespace gfx | 56 } // namespace gfx |
57 | 57 |
58 | 58 |
59 #endif // UI_GFX_CANVAS_PAINT_MAC_H_ | 59 #endif // UI_GFX_CANVAS_PAINT_MAC_H_ |
OLD | NEW |