OLD | NEW |
1 | 1 |
2 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 // Copyright (c) 2009 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 SKIA_EXT_CANVAS_PAINT_LINUX_H_ | 6 #ifndef SKIA_EXT_CANVAS_PAINT_LINUX_H_ |
7 #define SKIA_EXT_CANVAS_PAINT_LINUX_H_ | 7 #define SKIA_EXT_CANVAS_PAINT_LINUX_H_ |
8 #pragma once | 8 #pragma once |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 GdkRectangle bounds = rectangle(); | 85 GdkRectangle bounds = rectangle(); |
86 if (!T::initialize(bounds.width, bounds.height, opaque, NULL)) { | 86 if (!T::initialize(bounds.width, bounds.height, opaque, NULL)) { |
87 // Cause a deliberate crash; | 87 // Cause a deliberate crash; |
88 CHECK(false); | 88 CHECK(false); |
89 } | 89 } |
90 | 90 |
91 // Need to translate so that the dirty region appears at the origin of the | 91 // Need to translate so that the dirty region appears at the origin of the |
92 // surface. | 92 // surface. |
93 T::translate(-SkIntToScalar(bounds.x), -SkIntToScalar(bounds.y)); | 93 T::translate(-SkIntToScalar(bounds.x), -SkIntToScalar(bounds.y)); |
94 | 94 |
95 context_ = T::getTopPlatformDevice().BeginPlatformPaint(); | 95 context_ = BeginPlatformPaint(GetTopDevice(*this)); |
96 } | 96 } |
97 | 97 |
98 cairo_t* context_; | 98 cairo_t* context_; |
99 GdkWindow* window_; | 99 GdkWindow* window_; |
100 GdkRegion* region_; | 100 GdkRegion* region_; |
101 // See description above setter. | 101 // See description above setter. |
102 bool composite_alpha_; | 102 bool composite_alpha_; |
103 | 103 |
104 // Disallow copy and assign. | 104 // Disallow copy and assign. |
105 CanvasPaintT(const CanvasPaintT&); | 105 CanvasPaintT(const CanvasPaintT&); |
106 CanvasPaintT& operator=(const CanvasPaintT&); | 106 CanvasPaintT& operator=(const CanvasPaintT&); |
107 }; | 107 }; |
108 | 108 |
109 typedef CanvasPaintT<PlatformCanvas> PlatformCanvasPaint; | 109 typedef CanvasPaintT<PlatformCanvas> PlatformCanvasPaint; |
110 | 110 |
111 } // namespace skia | 111 } // namespace skia |
112 | 112 |
113 #endif // SKIA_EXT_CANVAS_PAINT_LINUX_H_ | 113 #endif // SKIA_EXT_CANVAS_PAINT_LINUX_H_ |
OLD | NEW |