Try out refFoo pattern on GrRenderTargetContext
Change-Id: Ifae5618f30c2202b9083f479b58556709ff6126a Reviewed-on: https://skia-review.googlesource.com/6990 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
This commit is contained in:
parent
550148ba57
commit
75a475cf2e
@ -357,6 +357,7 @@ public:
|
||||
bool isGammaCorrect() const { return SkToBool(fColorSpace.get()); }
|
||||
const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; }
|
||||
SkColorSpace* getColorSpace() const { return fColorSpace.get(); }
|
||||
sk_sp<SkColorSpace> refColorSpace() const { return fColorSpace; }
|
||||
GrColorSpaceXform* getColorXformFromSRGB() const { return fColorXformFromSRGB.get(); }
|
||||
GrSurfaceOrigin origin() const { return fRenderTargetProxy->origin(); }
|
||||
|
||||
|
@ -176,7 +176,7 @@ sk_sp<SkSpecialImage> SkBlurImageFilterImpl::onFilterImage(SkSpecialImage* sourc
|
||||
return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(dstBounds.width(), dstBounds.height()),
|
||||
kNeedNewImageUniqueID_SpecialImage,
|
||||
renderTargetContext->asTexture(),
|
||||
sk_ref_sp(renderTargetContext->getColorSpace()),
|
||||
renderTargetContext->refColorSpace(),
|
||||
&source->props());
|
||||
}
|
||||
#endif
|
||||
|
@ -304,7 +304,7 @@ sk_sp<SkSpecialImage> SkImageFilter::DrawWithFP(GrContext* context,
|
||||
return SkSpecialImage::MakeDeferredFromGpu(context, dstIRect,
|
||||
kNeedNewImageUniqueID_SpecialImage,
|
||||
sk_ref_sp(renderTargetContext->asDeferredTexture()),
|
||||
sk_ref_sp(renderTargetContext->getColorSpace()));
|
||||
renderTargetContext->refColorSpace());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -143,7 +143,7 @@ public:
|
||||
this->subset(),
|
||||
kNeedNewImageUniqueID_SpecialImage,
|
||||
fRenderTargetContext->asTexture(),
|
||||
sk_ref_sp(fRenderTargetContext->getColorSpace()),
|
||||
fRenderTargetContext->refColorSpace(),
|
||||
&this->props()));
|
||||
fRenderTargetContext = nullptr;
|
||||
return tmp;
|
||||
|
@ -410,7 +410,7 @@ sk_sp<SkSpecialImage> ArithmeticImageFilterImpl::filterImageGPU(
|
||||
SkIRect::MakeWH(bounds.width(), bounds.height()),
|
||||
kNeedNewImageUniqueID_SpecialImage,
|
||||
sk_ref_sp(renderTargetContext->asDeferredTexture()),
|
||||
sk_ref_sp(renderTargetContext->getColorSpace()));
|
||||
renderTargetContext->refColorSpace());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -376,7 +376,7 @@ sk_sp<SkSpecialImage> SkDisplacementMapEffect::onFilterImage(SkSpecialImage* sou
|
||||
SkIRect::MakeWH(bounds.width(), bounds.height()),
|
||||
kNeedNewImageUniqueID_SpecialImage,
|
||||
sk_ref_sp(renderTargetContext->asDeferredTexture()),
|
||||
sk_ref_sp(renderTargetContext->getColorSpace()));
|
||||
renderTargetContext->refColorSpace());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -467,7 +467,7 @@ sk_sp<SkSpecialImage> SkLightingImageFilterInternal::filterImageGPU(
|
||||
SkIRect::MakeWH(offsetBounds.width(), offsetBounds.height()),
|
||||
kNeedNewImageUniqueID_SpecialImage,
|
||||
sk_ref_sp(renderTargetContext->asDeferredTexture()),
|
||||
sk_ref_sp(renderTargetContext->getColorSpace()));
|
||||
renderTargetContext->refColorSpace());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -312,7 +312,7 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter_Base::filterImageGPU(
|
||||
SkIRect::MakeWH(bounds.width(), bounds.height()),
|
||||
kNeedNewImageUniqueID_SpecialImage,
|
||||
sk_ref_sp(renderTargetContext->asDeferredTexture()),
|
||||
sk_ref_sp(renderTargetContext->getColorSpace()));
|
||||
renderTargetContext->refColorSpace());
|
||||
}
|
||||
|
||||
sk_sp<GrFragmentProcessor>
|
||||
|
@ -129,7 +129,7 @@ static SkImageInfo make_info(GrRenderTargetContext* context, int w, int h, bool
|
||||
}
|
||||
return SkImageInfo::Make(w, h, colorType,
|
||||
opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType,
|
||||
sk_ref_sp(context->getColorSpace()));
|
||||
context->refColorSpace());
|
||||
}
|
||||
|
||||
SkGpuDevice::SkGpuDevice(GrContext* context, sk_sp<GrRenderTargetContext> renderTargetContext,
|
||||
@ -1800,7 +1800,7 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint
|
||||
fit,
|
||||
cinfo.fInfo.width(), cinfo.fInfo.height(),
|
||||
fRenderTargetContext->config(),
|
||||
sk_ref_sp(fRenderTargetContext->getColorSpace()),
|
||||
fRenderTargetContext->refColorSpace(),
|
||||
fRenderTargetContext->desc().fSampleCnt,
|
||||
kDefault_GrSurfaceOrigin,
|
||||
&props));
|
||||
|
@ -306,7 +306,7 @@ static sk_sp<SkImage> make_from_yuv_textures_copy(GrContext* ctx, SkYUVColorSpac
|
||||
ctx->flushSurfaceWrites(renderTargetContext->accessRenderTarget());
|
||||
return sk_make_sp<SkImage_Gpu>(width, height, kNeedNewImageUniqueID,
|
||||
kOpaque_SkAlphaType, renderTargetContext->asTexture(),
|
||||
sk_ref_sp(renderTargetContext->getColorSpace()), budgeted);
|
||||
renderTargetContext->refColorSpace(), budgeted);
|
||||
}
|
||||
|
||||
sk_sp<SkImage> SkImage::MakeFromYUVTexturesCopy(GrContext* ctx, SkYUVColorSpace colorSpace,
|
||||
|
Loading…
Reference in New Issue
Block a user