| 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_H_ | 5 #ifndef UI_GFX_CANVAS_H_ |
| 6 #define UI_GFX_CANVAS_H_ | 6 #define UI_GFX_CANVAS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/string16.h" | 11 #include "base/string16.h" |
| 12 // TODO(beng): remove these includes when we no longer depend on SkTypes. | 12 // TODO(beng): remove these includes when we no longer depend on SkTypes. |
| 13 #include "third_party/skia/include/core/SkColor.h" | 13 #include "third_party/skia/include/core/SkColor.h" |
| 14 #include "third_party/skia/include/core/SkXfermode.h" | 14 #include "third_party/skia/include/core/SkXfermode.h" |
| 15 #include "ui/base/ui_export.h" | 15 #include "ui/base/ui_export.h" |
| 16 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
| 17 | 17 |
| 18 class SkCanvas; | 18 class SkCanvas; |
| 19 | 19 |
| 20 namespace ui { | 20 namespace ui { |
| 21 class Transform; | 21 class Transform; |
| 22 typedef unsigned int TextureID; | |
| 23 } | 22 } |
| 24 | 23 |
| 25 namespace gfx { | 24 namespace gfx { |
| 26 | 25 |
| 27 class Brush; | 26 class Brush; |
| 28 class CanvasSkia; | 27 class CanvasSkia; |
| 29 class Font; | 28 class Font; |
| 30 class Point; | 29 class Point; |
| 31 class Rect; | 30 class Rect; |
| 32 class Size; | 31 class Size; |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 // use. Must be balanced by a call to EndPlatformPaint(). | 207 // use. Must be balanced by a call to EndPlatformPaint(). |
| 209 virtual gfx::NativeDrawingContext BeginPlatformPaint() = 0; | 208 virtual gfx::NativeDrawingContext BeginPlatformPaint() = 0; |
| 210 | 209 |
| 211 // Signifies the end of platform drawing using the native drawing context | 210 // Signifies the end of platform drawing using the native drawing context |
| 212 // returned by BeginPlatformPaint(). | 211 // returned by BeginPlatformPaint(). |
| 213 virtual void EndPlatformPaint() = 0; | 212 virtual void EndPlatformPaint() = 0; |
| 214 | 213 |
| 215 // Apply transformation on the canvas. | 214 // Apply transformation on the canvas. |
| 216 virtual void Transform(const ui::Transform& transform) = 0; | 215 virtual void Transform(const ui::Transform& transform) = 0; |
| 217 | 216 |
| 218 // Create a texture ID that can be used for accelerated drawing. | |
| 219 virtual ui::TextureID GetTextureID() = 0; | |
| 220 | |
| 221 // TODO(beng): remove this once we don't need to use any skia-specific methods | 217 // TODO(beng): remove this once we don't need to use any skia-specific methods |
| 222 // through this interface. | 218 // through this interface. |
| 223 // A quick and dirty way to obtain the underlying SkCanvas. | 219 // A quick and dirty way to obtain the underlying SkCanvas. |
| 224 virtual CanvasSkia* AsCanvasSkia(); | 220 virtual CanvasSkia* AsCanvasSkia(); |
| 225 virtual const CanvasSkia* AsCanvasSkia() const; | 221 virtual const CanvasSkia* AsCanvasSkia() const; |
| 226 virtual SkCanvas* GetSkCanvas(); | 222 virtual SkCanvas* GetSkCanvas(); |
| 227 virtual const SkCanvas* GetSkCanvas() const; | 223 virtual const SkCanvas* GetSkCanvas() const; |
| 228 }; | 224 }; |
| 229 | 225 |
| 230 class UI_EXPORT CanvasPaint { | 226 class UI_EXPORT CanvasPaint { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 241 // Returns the rectangle that is invalid. | 237 // Returns the rectangle that is invalid. |
| 242 virtual gfx::Rect GetInvalidRect() const = 0; | 238 virtual gfx::Rect GetInvalidRect() const = 0; |
| 243 | 239 |
| 244 // Returns the underlying Canvas. | 240 // Returns the underlying Canvas. |
| 245 virtual Canvas* AsCanvas() = 0; | 241 virtual Canvas* AsCanvas() = 0; |
| 246 }; | 242 }; |
| 247 | 243 |
| 248 } // namespace gfx | 244 } // namespace gfx |
| 249 | 245 |
| 250 #endif // UI_GFX_CANVAS_H_ | 246 #endif // UI_GFX_CANVAS_H_ |
| OLD | NEW |