| Index: src/core/SkSpecialSurface.cpp
|
| diff --git a/src/core/SkSpecialSurface.cpp b/src/core/SkSpecialSurface.cpp
|
| index eecdaecd612b2c81be413d745f646f053f3b21c8..2e2d8cc54a64ea87cb348e2411673eb3688bd91c 100644
|
| --- a/src/core/SkSpecialSurface.cpp
|
| +++ b/src/core/SkSpecialSurface.cpp
|
| @@ -13,9 +13,8 @@
|
| ///////////////////////////////////////////////////////////////////////////////
|
| class SkSpecialSurface_Base : public SkSpecialSurface {
|
| public:
|
| - SkSpecialSurface_Base(SkImageFilter::Proxy* proxy,
|
| - const SkIRect& subset, const SkSurfaceProps* props)
|
| - : INHERITED(proxy, subset, props)
|
| + SkSpecialSurface_Base(const SkIRect& subset, const SkSurfaceProps* props)
|
| + : INHERITED(subset, props)
|
| , fCanvas(nullptr) {
|
| }
|
|
|
| @@ -41,12 +40,10 @@ static SkSpecialSurface_Base* as_SB(SkSpecialSurface* surface) {
|
| return static_cast<SkSpecialSurface_Base*>(surface);
|
| }
|
|
|
| -SkSpecialSurface::SkSpecialSurface(SkImageFilter::Proxy* proxy,
|
| - const SkIRect& subset,
|
| +SkSpecialSurface::SkSpecialSurface(const SkIRect& subset,
|
| const SkSurfaceProps* props)
|
| : fProps(SkSurfacePropsCopyOrDefault(props).flags(), kUnknown_SkPixelGeometry)
|
| - , fSubset(subset)
|
| - , fProxy(proxy) {
|
| + , fSubset(subset) {
|
| SkASSERT(fSubset.width() > 0);
|
| SkASSERT(fSubset.height() > 0);
|
| }
|
| @@ -66,11 +63,10 @@ sk_sp<SkSpecialImage> SkSpecialSurface::makeImageSnapshot() {
|
|
|
| class SkSpecialSurface_Raster : public SkSpecialSurface_Base {
|
| public:
|
| - SkSpecialSurface_Raster(SkImageFilter::Proxy* proxy,
|
| - SkPixelRef* pr,
|
| + SkSpecialSurface_Raster(SkPixelRef* pr,
|
| const SkIRect& subset,
|
| const SkSurfaceProps* props)
|
| - : INHERITED(proxy, subset, props) {
|
| + : INHERITED(subset, props) {
|
| const SkImageInfo& info = pr->info();
|
|
|
| fBitmap.setInfo(info, info.minRowBytes());
|
| @@ -83,8 +79,7 @@ public:
|
| ~SkSpecialSurface_Raster() override { }
|
|
|
| sk_sp<SkSpecialImage> onMakeImageSnapshot() override {
|
| - return SkSpecialImage::MakeFromRaster(this->proxy(), this->subset(), fBitmap,
|
| - &this->props());
|
| + return SkSpecialImage::MakeFromRaster(this->subset(), fBitmap, &this->props());
|
| }
|
|
|
| private:
|
| @@ -93,14 +88,12 @@ private:
|
| typedef SkSpecialSurface_Base INHERITED;
|
| };
|
|
|
| -sk_sp<SkSpecialSurface> SkSpecialSurface::MakeFromBitmap(SkImageFilter::Proxy* proxy,
|
| - const SkIRect& subset, SkBitmap& bm,
|
| +sk_sp<SkSpecialSurface> SkSpecialSurface::MakeFromBitmap(const SkIRect& subset, SkBitmap& bm,
|
| const SkSurfaceProps* props) {
|
| - return sk_make_sp<SkSpecialSurface_Raster>(proxy, bm.pixelRef(), subset, props);
|
| + return sk_make_sp<SkSpecialSurface_Raster>(bm.pixelRef(), subset, props);
|
| }
|
|
|
| -sk_sp<SkSpecialSurface> SkSpecialSurface::MakeRaster(SkImageFilter::Proxy* proxy,
|
| - const SkImageInfo& info,
|
| +sk_sp<SkSpecialSurface> SkSpecialSurface::MakeRaster(const SkImageInfo& info,
|
| const SkSurfaceProps* props) {
|
| SkAutoTUnref<SkPixelRef> pr(SkMallocPixelRef::NewZeroed(info, 0, nullptr));
|
| if (nullptr == pr.get()) {
|
| @@ -109,7 +102,7 @@ sk_sp<SkSpecialSurface> SkSpecialSurface::MakeRaster(SkImageFilter::Proxy* proxy
|
|
|
| const SkIRect subset = SkIRect::MakeWH(pr->info().width(), pr->info().height());
|
|
|
| - return sk_make_sp<SkSpecialSurface_Raster>(proxy, pr, subset, props);
|
| + return sk_make_sp<SkSpecialSurface_Raster>(pr, subset, props);
|
| }
|
|
|
| #if SK_SUPPORT_GPU
|
| @@ -119,11 +112,10 @@ sk_sp<SkSpecialSurface> SkSpecialSurface::MakeRaster(SkImageFilter::Proxy* proxy
|
|
|
| class SkSpecialSurface_Gpu : public SkSpecialSurface_Base {
|
| public:
|
| - SkSpecialSurface_Gpu(SkImageFilter::Proxy* proxy,
|
| - GrTexture* texture,
|
| + SkSpecialSurface_Gpu(GrTexture* texture,
|
| const SkIRect& subset,
|
| const SkSurfaceProps* props)
|
| - : INHERITED(proxy, subset, props)
|
| + : INHERITED(subset, props)
|
| , fTexture(SkRef(texture)) {
|
|
|
| SkASSERT(fTexture->asRenderTarget());
|
| @@ -141,7 +133,7 @@ public:
|
| ~SkSpecialSurface_Gpu() override { }
|
|
|
| sk_sp<SkSpecialImage> onMakeImageSnapshot() override {
|
| - return SkSpecialImage::MakeFromGpu(this->proxy(), this->subset(),
|
| + return SkSpecialImage::MakeFromGpu(this->subset(),
|
| kNeedNewImageUniqueID_SpecialImage, fTexture,
|
| &this->props());
|
| }
|
| @@ -152,19 +144,17 @@ private:
|
| typedef SkSpecialSurface_Base INHERITED;
|
| };
|
|
|
| -sk_sp<SkSpecialSurface> SkSpecialSurface::MakeFromTexture(SkImageFilter::Proxy* proxy,
|
| - const SkIRect& subset,
|
| +sk_sp<SkSpecialSurface> SkSpecialSurface::MakeFromTexture(const SkIRect& subset,
|
| GrTexture* texture,
|
| const SkSurfaceProps* props) {
|
| if (!texture->asRenderTarget()) {
|
| return nullptr;
|
| }
|
|
|
| - return sk_make_sp<SkSpecialSurface_Gpu>(proxy, texture, subset, props);
|
| + return sk_make_sp<SkSpecialSurface_Gpu>(texture, subset, props);
|
| }
|
|
|
| -sk_sp<SkSpecialSurface> SkSpecialSurface::MakeRenderTarget(SkImageFilter::Proxy* proxy,
|
| - GrContext* context,
|
| +sk_sp<SkSpecialSurface> SkSpecialSurface::MakeRenderTarget(GrContext* context,
|
| const GrSurfaceDesc& desc,
|
| const SkSurfaceProps* props) {
|
| if (!context || !SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag)) {
|
| @@ -178,20 +168,18 @@ sk_sp<SkSpecialSurface> SkSpecialSurface::MakeRenderTarget(SkImageFilter::Proxy*
|
|
|
| const SkIRect subset = SkIRect::MakeWH(desc.fWidth, desc.fHeight);
|
|
|
| - return sk_make_sp<SkSpecialSurface_Gpu>(proxy, temp, subset, props);
|
| + return sk_make_sp<SkSpecialSurface_Gpu>(temp, subset, props);
|
| }
|
|
|
| #else
|
|
|
| -sk_sp<SkSpecialSurface> SkSpecialSurface::MakeFromTexture(SkImageFilter::Proxy* proxy,
|
| - const SkIRect& subset,
|
| +sk_sp<SkSpecialSurface> SkSpecialSurface::MakeFromTexture(const SkIRect& subset,
|
| GrTexture*,
|
| const SkSurfaceProps*) {
|
| return nullptr;
|
| }
|
|
|
| -sk_sp<SkSpecialSurface> SkSpecialSurface::MakeRenderTarget(SkImageFilter::Proxy* proxy,
|
| - GrContext* context,
|
| +sk_sp<SkSpecialSurface> SkSpecialSurface::MakeRenderTarget(GrContext* context,
|
| const GrSurfaceDesc& desc,
|
| const SkSurfaceProps* props) {
|
| return nullptr;
|
|
|