| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_SKIA_PAINT_H_ | 5 #ifndef UI_GFX_CANVAS_SKIA_PAINT_H_ |
| 6 #define UI_GFX_CANVAS_SKIA_PAINT_H_ | 6 #define UI_GFX_CANVAS_SKIA_PAINT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "skia/ext/canvas_paint.h" | 9 #include "skia/ext/canvas_paint.h" |
| 10 #include "ui/gfx/canvas_skia.h" | 10 #include "ui/gfx/canvas_skia.h" |
| 11 | 11 |
| 12 // Define a gfx::CanvasSkiaPaint type that wraps our gfx::Canvas like the | 12 // Define a gfx::CanvasSkiaPaint type that wraps our gfx::Canvas like the |
| 13 // skia::PlatformCanvasPaint wraps PlatformCanvas. | 13 // skia::PlatformCanvasPaint wraps PlatformCanvas. |
| 14 | 14 |
| 15 namespace skia { |
| 16 |
| 17 template<> inline |
| 18 PlatformCanvas* GetPlatformCanvas(skia::CanvasPaintT<gfx::CanvasSkia>* canvas) { |
| 19 PlatformCanvas* platform_canvas = canvas->platform_canvas(); |
| 20 DCHECK(platform_canvas); |
| 21 return platform_canvas; |
| 22 } |
| 23 |
| 24 } // namespace skia |
| 25 |
| 15 namespace gfx { | 26 namespace gfx { |
| 16 | 27 |
| 17 typedef skia::CanvasPaintT<CanvasSkia> CanvasSkiaPaint; | 28 typedef skia::CanvasPaintT<CanvasSkia> CanvasSkiaPaint; |
| 18 | 29 |
| 19 } // namespace gfx | 30 } // namespace gfx |
| 20 | 31 |
| 21 #endif // UI_GFX_CANVAS_SKIA_PAINT_H_ | 32 #endif // UI_GFX_CANVAS_SKIA_PAINT_H_ |
| OLD | NEW |