| Index: skia/ext/platform_canvas.cc
|
| ===================================================================
|
| --- skia/ext/platform_canvas.cc (revision 85672)
|
| +++ skia/ext/platform_canvas.cc (working copy)
|
| @@ -8,11 +8,12 @@
|
| #include "third_party/skia/include/core/SkTypes.h"
|
|
|
| namespace {
|
| -skia::PlatformDevice* GetTopPlatformDevice(const SkCanvas* canvas) {
|
| - // All of our devices should be our special PlatformDevice.
|
| +
|
| +SkDevice* GetTopDevice(const SkCanvas* canvas) {
|
| SkCanvas::LayerIter iter(const_cast<SkCanvas*>(canvas), false);
|
| - return static_cast<skia::PlatformDevice*>(iter.device());
|
| + return iter.device();
|
| }
|
| +
|
| }
|
|
|
| namespace skia {
|
| @@ -29,8 +30,8 @@
|
| return NULL;
|
| }
|
|
|
| -PlatformDevice& PlatformCanvas::getTopPlatformDevice() const {
|
| - return *GetTopPlatformDevice(this);
|
| +SkDevice& PlatformCanvas::getTopDevice() const {
|
| + return *GetTopDevice(this);
|
| }
|
|
|
| // static
|
| @@ -52,17 +53,18 @@
|
| }
|
|
|
| bool SupportsPlatformPaint(const SkCanvas* canvas) {
|
| - // TODO(alokp): Rename PlatformDevice::IsNativeFontRenderingAllowed after
|
| + // TODO(alokp): Rename platform_util::IsNativeFontRenderingAllowed after
|
| // removing these calls from WebKit.
|
| - return GetTopPlatformDevice(canvas)->IsNativeFontRenderingAllowed();
|
| + return skia::platform_util::IsNativeFontRenderingAllowed(
|
| + GetTopDevice(canvas));
|
| }
|
|
|
| -PlatformDevice::PlatformSurface BeginPlatformPaint(SkCanvas* canvas) {
|
| - return GetTopPlatformDevice(canvas)->BeginPlatformPaint();
|
| +platform_util::PlatformSurface BeginPlatformPaint(SkCanvas* canvas) {
|
| + return platform_util::BeginPlatformPaint(GetTopDevice(canvas));
|
| }
|
|
|
| void EndPlatformPaint(SkCanvas* canvas) {
|
| - GetTopPlatformDevice(canvas)->EndPlatformPaint();
|
| + platform_util::EndPlatformPaint(GetTopDevice(canvas));
|
| }
|
|
|
| } // namespace skia
|
|
|