OLD | NEW |
1 | 1 |
2 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 // Copyright (c) 2011 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_LINUX_H_ | 6 #ifndef UI_GFX_CANVAS_PAINT_LINUX_H_ |
7 #define UI_GFX_CANVAS_PAINT_LINUX_H_ | 7 #define UI_GFX_CANVAS_PAINT_LINUX_H_ |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "skia/ext/platform_canvas.h" | 10 #include "skia/ext/platform_canvas.h" |
11 #include "ui/gfx/canvas.h" | 11 #include "ui/gfx/canvas.h" |
12 #include <gdk/gdk.h> | 12 #include <gdk/gdk.h> |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 | 15 |
16 // A class designed to translate skia painting into a region in a GdkWindow. | 16 // A class designed to translate skia painting into a region in a GdkWindow. |
17 // On construction, it will set up a context for painting into, and on | 17 // On construction, it will set up a context for painting into, and on |
18 // destruction, it will commit it to the GdkWindow. | 18 // destruction, it will commit it to the GdkWindow. |
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(GdkEventExpose* event); | 23 explicit CanvasSkiaPaint(GdkEventExpose* event); |
24 CanvasSkiaPaint(GdkEventExpose* event, bool opaque); | 24 CanvasSkiaPaint(GdkEventExpose* event, bool opaque); |
25 virtual ~CanvasSkiaPaint(); | 25 virtual ~CanvasSkiaPaint(); |
26 | 26 |
27 // Sets whether the bitmap is composited in such a way that the alpha channel | 27 // Sets whether the bitmap is composited in such a way that the alpha channel |
28 // is honored. This is only useful if you've enabled an RGBA colormap on the | 28 // is honored. This is only useful if you've enabled an RGBA colormap on the |
29 // widget. The default is false. | 29 // widget. The default is false. |
30 void set_composite_alpha(bool composite_alpha) { | 30 void set_composite_alpha(bool composite_alpha) { |
(...skipping 22 matching lines...) Expand all Loading... |
53 bool composite_alpha_; | 53 bool composite_alpha_; |
54 | 54 |
55 // Disallow copy and assign. | 55 // Disallow copy and assign. |
56 CanvasSkiaPaint(const CanvasSkiaPaint&); | 56 CanvasSkiaPaint(const CanvasSkiaPaint&); |
57 CanvasSkiaPaint& operator=(const CanvasSkiaPaint&); | 57 CanvasSkiaPaint& operator=(const CanvasSkiaPaint&); |
58 }; | 58 }; |
59 | 59 |
60 } // namespace gfx | 60 } // namespace gfx |
61 | 61 |
62 #endif // UI_GFX_CANVAS_PAINT_LINUX_H_ | 62 #endif // UI_GFX_CANVAS_PAINT_LINUX_H_ |
OLD | NEW |