| Index: skia/ext/platform_canvas.cc
|
| diff --git a/skia/ext/platform_canvas.cc b/skia/ext/platform_canvas.cc
|
| index f06d30cf7afc9d203611918aab32dd493a9e346e..72d81f22c269edab1c95d5add242f552eeacd603 100644
|
| --- a/skia/ext/platform_canvas.cc
|
| +++ b/skia/ext/platform_canvas.cc
|
| @@ -65,20 +65,6 @@ bool SupportsPlatformPaint(const SkCanvas* canvas) {
|
| return GetPlatformDevice(GetTopDevice(*canvas)) != nullptr;
|
| }
|
|
|
| -PlatformSurface BeginPlatformPaint(SkCanvas* canvas) {
|
| - PlatformDevice* platform_device = GetPlatformDevice(GetTopDevice(*canvas));
|
| - if (platform_device)
|
| - return platform_device->BeginPlatformPaint();
|
| -
|
| - return 0;
|
| -}
|
| -
|
| -void EndPlatformPaint(SkCanvas* canvas) {
|
| - PlatformDevice* platform_device = GetPlatformDevice(GetTopDevice(*canvas));
|
| - if (platform_device)
|
| - platform_device->EndPlatformPaint();
|
| -}
|
| -
|
| size_t PlatformCanvasStrideForWidth(unsigned width) {
|
| return 4 * width;
|
| }
|
| @@ -116,5 +102,12 @@ CGContextRef GetBitmapContext(const SkCanvas& canvas) {
|
|
|
| #endif
|
|
|
| +ScopedPlatformPaint::ScopedPlatformPaint(SkCanvas* canvas) :
|
| + canvas_(canvas),
|
| + platform_surface_(nullptr) {
|
| + PlatformDevice* platform_device = GetPlatformDevice(GetTopDevice(*canvas));
|
| + if (platform_device)
|
| + platform_surface_ = platform_device->BeginPlatformPaint();
|
| +}
|
|
|
| } // namespace skia
|
|
|