OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 GFX_CANVAS_H_ | 5 #ifndef GFX_CANVAS_H_ |
6 #define GFX_CANVAS_H_ | 6 #define GFX_CANVAS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 // use. Must be balanced by a call to EndPlatformPaint(). | 203 // use. Must be balanced by a call to EndPlatformPaint(). |
204 virtual gfx::NativeDrawingContext BeginPlatformPaint() = 0; | 204 virtual gfx::NativeDrawingContext BeginPlatformPaint() = 0; |
205 | 205 |
206 // Signifies the end of platform drawing using the native drawing context | 206 // Signifies the end of platform drawing using the native drawing context |
207 // returned by BeginPlatformPaint(). | 207 // returned by BeginPlatformPaint(). |
208 virtual void EndPlatformPaint() = 0; | 208 virtual void EndPlatformPaint() = 0; |
209 | 209 |
210 // TODO(beng): remove this once we don't need to use any skia-specific methods | 210 // TODO(beng): remove this once we don't need to use any skia-specific methods |
211 // through this interface. | 211 // through this interface. |
212 // A quick and dirty way to obtain the underlying SkCanvas. | 212 // A quick and dirty way to obtain the underlying SkCanvas. |
213 virtual CanvasSkia* AsCanvasSkia() { return NULL; } | 213 virtual CanvasSkia* AsCanvasSkia(); |
214 virtual const CanvasSkia* AsCanvasSkia() const { return NULL; } | 214 virtual const CanvasSkia* AsCanvasSkia() const; |
215 }; | 215 }; |
216 | 216 |
217 class CanvasPaint { | 217 class CanvasPaint { |
218 public: | 218 public: |
219 virtual ~CanvasPaint() {} | 219 virtual ~CanvasPaint() {} |
220 | 220 |
221 // Creates a canvas that paints to |view| when it is destroyed. The canvas is | 221 // Creates a canvas that paints to |view| when it is destroyed. The canvas is |
222 // sized to the client area of |view|. | 222 // sized to the client area of |view|. |
223 static CanvasPaint* CreateCanvasPaint(gfx::NativeView view); | 223 static CanvasPaint* CreateCanvasPaint(gfx::NativeView view); |
224 | 224 |
225 // Returns true if the canvas has an invalid rect that needs to be repainted. | 225 // Returns true if the canvas has an invalid rect that needs to be repainted. |
226 virtual bool IsValid() const = 0; | 226 virtual bool IsValid() const = 0; |
227 | 227 |
228 // Returns the rectangle that is invalid. | 228 // Returns the rectangle that is invalid. |
229 virtual gfx::Rect GetInvalidRect() const = 0; | 229 virtual gfx::Rect GetInvalidRect() const = 0; |
230 | 230 |
231 // Returns the underlying Canvas. | 231 // Returns the underlying Canvas. |
232 virtual Canvas* AsCanvas() = 0; | 232 virtual Canvas* AsCanvas() = 0; |
233 }; | 233 }; |
234 | 234 |
235 } // namespace gfx; | 235 } // namespace gfx; |
236 | 236 |
237 #endif // GFX_CANVAS_H_ | 237 #endif // GFX_CANVAS_H_ |
OLD | NEW |