| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkAndroidSDKCanvas.h" | 8 #include "SkAndroidSDKCanvas.h" |
| 9 | 9 |
| 10 #include "SkColorFilter.h" | 10 #include "SkColorFilter.h" |
| 11 #include "SkDrawLooper.h" | 11 #include "SkDrawLooper.h" |
| 12 #include "SkPaint.h" | 12 #include "SkPaint.h" |
| 13 #include "SkPathEffect.h" | 13 #include "SkPathEffect.h" |
| 14 #include "SkShader.h" | 14 #include "SkShader.h" |
| 15 #include "SkSurface.h" |
| 15 #include "SkTLazy.h" | 16 #include "SkTLazy.h" |
| 16 | 17 |
| 17 namespace { | 18 namespace { |
| 18 | 19 |
| 19 /** Discard SkShaders not exposed by the Android Java API. */ | 20 /** Discard SkShaders not exposed by the Android Java API. */ |
| 20 | 21 |
| 21 void CheckShader(SkPaint* paint) { | 22 void CheckShader(SkPaint* paint) { |
| 22 SkShader* shader = paint->getShader(); | 23 SkShader* shader = paint->getShader(); |
| 23 if (!shader) { | 24 if (!shader) { |
| 24 return; | 25 return; |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 bool SkAndroidSDKCanvas::getClipBounds(SkRect* rect) const { | 281 bool SkAndroidSDKCanvas::getClipBounds(SkRect* rect) const { |
| 281 return fProxyTarget->getClipBounds(rect); | 282 return fProxyTarget->getClipBounds(rect); |
| 282 } | 283 } |
| 283 bool SkAndroidSDKCanvas::getClipDeviceBounds(SkIRect* rect) const { | 284 bool SkAndroidSDKCanvas::getClipDeviceBounds(SkIRect* rect) const { |
| 284 return fProxyTarget->getClipDeviceBounds(rect); | 285 return fProxyTarget->getClipDeviceBounds(rect); |
| 285 } | 286 } |
| 286 | 287 |
| 287 bool SkAndroidSDKCanvas::isClipEmpty() const { return fProxyTarget->isClipEmpty(
); } | 288 bool SkAndroidSDKCanvas::isClipEmpty() const { return fProxyTarget->isClipEmpty(
); } |
| 288 bool SkAndroidSDKCanvas::isClipRect() const { return fProxyTarget->isClipRect();
} | 289 bool SkAndroidSDKCanvas::isClipRect() const { return fProxyTarget->isClipRect();
} |
| 289 | 290 |
| 290 SkSurface* SkAndroidSDKCanvas::onNewSurface(const SkImageInfo& info, | 291 sk_sp<SkSurface> SkAndroidSDKCanvas::onNewSurface(const SkImageInfo& info, |
| 291 const SkSurfaceProps& props
) { | 292 const SkSurfaceProps& props) { |
| 292 return fProxyTarget->newSurface(info, &props); | 293 return fProxyTarget->makeSurface(info, &props); |
| 293 } | 294 } |
| 294 | 295 |
| 295 bool SkAndroidSDKCanvas::onPeekPixels(SkPixmap* pmap) { | 296 bool SkAndroidSDKCanvas::onPeekPixels(SkPixmap* pmap) { |
| 296 return fProxyTarget->peekPixels(pmap); | 297 return fProxyTarget->peekPixels(pmap); |
| 297 } | 298 } |
| 298 | 299 |
| 299 bool SkAndroidSDKCanvas::onAccessTopLayerPixels(SkPixmap* pmap) { | 300 bool SkAndroidSDKCanvas::onAccessTopLayerPixels(SkPixmap* pmap) { |
| 300 SkASSERT(pmap); | 301 SkASSERT(pmap); |
| 301 SkImageInfo info; | 302 SkImageInfo info; |
| 302 size_t rowBytes; | 303 size_t rowBytes; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 fProxyTarget->clipPath(path, op, style); | 350 fProxyTarget->clipPath(path, op, style); |
| 350 } | 351 } |
| 351 | 352 |
| 352 void SkAndroidSDKCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op) { | 353 void SkAndroidSDKCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op) { |
| 353 fProxyTarget->clipRegion(region, op); | 354 fProxyTarget->clipRegion(region, op); |
| 354 } | 355 } |
| 355 | 356 |
| 356 void SkAndroidSDKCanvas::onDiscard() { fProxyTarget->discard(); } | 357 void SkAndroidSDKCanvas::onDiscard() { fProxyTarget->discard(); } |
| 357 | 358 |
| 358 | 359 |
| OLD | NEW |