| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GFX_CANVAS_PAINT_H_ | 5 #ifndef UI_GFX_CANVAS_PAINT_H_ |
| 6 #define UI_GFX_CANVAS_PAINT_H_ | 6 #define UI_GFX_CANVAS_PAINT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ui/base/ui_export.h" | 9 #include "ui/base/ui_export.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 | 13 |
| 14 class Canvas; | 14 class CanvasSkia; |
| 15 class Rect; | 15 class Rect; |
| 16 | 16 |
| 17 class CanvasPaint { | 17 class CanvasPaint { |
| 18 public: | 18 public: |
| 19 // Creates a canvas that paints to |view| when it is destroyed. The canvas is | 19 // Creates a canvas that paints to |view| when it is destroyed. The canvas is |
| 20 // sized to the client area of |view|. | 20 // sized to the client area of |view|. |
| 21 UI_EXPORT static CanvasPaint* CreateCanvasPaint(gfx::NativeView view); | 21 UI_EXPORT static CanvasPaint* CreateCanvasPaint(gfx::NativeView view); |
| 22 | 22 |
| 23 virtual ~CanvasPaint() {} | 23 virtual ~CanvasPaint() {} |
| 24 | 24 |
| 25 // Returns true if the canvas has an invalid rect that needs to be repainted. | 25 // Returns true if the canvas has an invalid rect that needs to be repainted. |
| 26 virtual bool IsValid() const = 0; | 26 virtual bool IsValid() const = 0; |
| 27 | 27 |
| 28 // Returns the rectangle that is invalid. | 28 // Returns the rectangle that is invalid. |
| 29 virtual gfx::Rect GetInvalidRect() const = 0; | 29 virtual gfx::Rect GetInvalidRect() const = 0; |
| 30 | 30 |
| 31 // Returns the underlying Canvas. | 31 // Returns the underlying Canvas. |
| 32 virtual Canvas* AsCanvas() = 0; | 32 virtual CanvasSkia* AsCanvas() = 0; |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 } // namespace gfx | 35 } // namespace gfx |
| 36 | 36 |
| 37 #endif // UI_GFX_CANVAS_PAINT_H_ | 37 #endif // UI_GFX_CANVAS_PAINT_H_ |
| OLD | NEW |