desc.fWidth = kTexWidth;
desc.fHeight = kTexHeight;
- sk_sp<GrSurfaceProxy> proxy = GrSurfaceProxy::MakeDeferred(*context->caps(),
+ sk_sp<GrTextureProxy> proxy = GrSurfaceProxy::MakeDeferred(*context->caps(),
context->textureProvider(),
desc, SkBudgeted::kYes,
fETC1Data.get(), 0);
- if (!proxy || !proxy->asTextureProxy()) {
+ if (!proxy) {
return;
}
const SkMatrix trans = SkMatrix::MakeTrans(-kPad, -kPad);
- sk_sp<GrFragmentProcessor> fp = GrSimpleTextureEffect::Make(
- context,
- sk_ref_sp(proxy->asTextureProxy()),
- nullptr, trans);
+ sk_sp<GrFragmentProcessor> fp = GrSimpleTextureEffect::Make(context,
+ std::move(proxy),
+ nullptr, trans);
GrPaint grPaint;
grPaint.setXPFactory(GrPorterDuffXPFactory::Get(SkBlendMode::kSrc));
desc.fHeight = 2 * S;
desc.fConfig = SkImageInfo2GrPixelConfig(ii, *context->caps());
- sk_sp<GrSurfaceProxy> proxy = GrSurfaceProxy::MakeDeferred(*context->caps(),
+ sk_sp<GrTextureProxy> proxy = GrSurfaceProxy::MakeDeferred(*context->caps(),
context->textureProvider(),
desc, SkBudgeted::kNo,
gTextureData.get(), 0);
desc.fHeight = fBmp.height();
desc.fConfig = SkImageInfo2GrPixelConfig(fBmp.info(), *context->caps());
- sk_sp<GrSurfaceProxy> proxy(GrSurfaceProxy::MakeDeferred(*context->caps(),
+ sk_sp<GrTextureProxy> proxy(GrSurfaceProxy::MakeDeferred(*context->caps(),
context->textureProvider(),
desc, SkBudgeted::kYes,
fBmp.getPixels(),
fBmp.rowBytes()));
- if (!proxy || !proxy->asTextureProxy()) {
+ if (!proxy) {
return;
}
grPaint.setXPFactory(GrPorterDuffXPFactory::Get(SkBlendMode::kSrc));
sk_sp<GrFragmentProcessor> fp(
GrTextureDomainEffect::Make(
- context, sk_ref_sp(proxy->asTextureProxy()),
+ context, proxy,
nullptr, textureMatrices[tm],
GrTextureDomain::MakeTexelDomainForMode(texelDomains[d], mode),
mode, GrSamplerParams::kNone_FilterMode));
return;
}
- sk_sp<GrSurfaceProxy> proxy[3];
+ sk_sp<GrTextureProxy> proxy[3];
{
GrSurfaceDesc desc;
for (int i = 0; i < 6; ++i) {
sk_sp<GrFragmentProcessor> fp(
GrYUVEffect::MakeYUVToRGB(context,
- sk_ref_sp(proxy[indices[i][0]]->asTextureProxy()),
- sk_ref_sp(proxy[indices[i][1]]->asTextureProxy()),
- sk_ref_sp(proxy[indices[i][2]]->asTextureProxy()),
+ proxy[indices[i][0]],
+ proxy[indices[i][1]],
+ proxy[indices[i][2]],
sizes,
static_cast<SkYUVColorSpace>(space),
false));
return;
}
- sk_sp<GrSurfaceProxy> proxy[3];
+ sk_sp<GrTextureProxy> proxy[3];
{
GrSurfaceDesc desc;
GrPaint grPaint;
grPaint.setXPFactory(GrPorterDuffXPFactory::Get(SkBlendMode::kSrc));
sk_sp<GrFragmentProcessor> fp(
- GrYUVEffect::MakeYUVToRGB(context,
- sk_ref_sp(proxy[0]->asTextureProxy()),
- sk_ref_sp(proxy[1]->asTextureProxy()),
- sk_ref_sp(proxy[2]->asTextureProxy()),
+ GrYUVEffect::MakeYUVToRGB(context, proxy[0], proxy[1], proxy[2],
sizes, static_cast<SkYUVColorSpace>(space), true));
if (fp) {
SkMatrix viewMatrix;
static sk_sp<GrSurfaceProxy> MakeWrapped(sk_sp<GrSurface>);
static sk_sp<GrTextureProxy> MakeWrapped(sk_sp<GrTexture>);
- static sk_sp<GrSurfaceProxy> MakeDeferred(GrTextureProvider*, const GrCaps&,
+ static sk_sp<GrTextureProxy> MakeDeferred(GrTextureProvider*, const GrCaps&,
const GrSurfaceDesc&, SkBackingFit,
SkBudgeted, uint32_t flags = 0);
// TODO: need to refine ownership semantics of 'srcData' if we're in completely
// deferred mode
- static sk_sp<GrSurfaceProxy> MakeDeferred(const GrCaps&, GrTextureProvider*,
+ static sk_sp<GrTextureProxy> MakeDeferred(const GrCaps&, GrTextureProvider*,
const GrSurfaceDesc&, SkBudgeted,
const void* srcData, size_t rowBytes);
this->flush();
}
- sk_sp<GrTextureProxy> tempTextureProxy;
+ sk_sp<GrTextureProxy> tempProxy;
if (GrGpu::kNoDraw_DrawPreference != drawPreference) {
- sk_sp<GrSurfaceProxy> temp = GrSurfaceProxy::MakeDeferred(this->textureProvider(),
- *this->caps(),
- tempDrawInfo.fTempSurfaceDesc,
- SkBackingFit::kApprox,
- SkBudgeted::kYes);
- if (temp) {
- tempTextureProxy = sk_ref_sp(temp->asTextureProxy());
- }
- if (!tempTextureProxy && GrGpu::kRequireDraw_DrawPreference == drawPreference) {
+ tempProxy = GrSurfaceProxy::MakeDeferred(this->textureProvider(),
+ *this->caps(),
+ tempDrawInfo.fTempSurfaceDesc,
+ SkBackingFit::kApprox,
+ SkBudgeted::kYes);
+ if (!tempProxy && GrGpu::kRequireDraw_DrawPreference == drawPreference) {
return false;
}
}
// temp buffer for doing sw premul conversion, if needed.
SkAutoSTMalloc<128 * 128, uint32_t> tmpPixels(0);
- if (tempTextureProxy) {
+ if (tempProxy) {
sk_sp<GrFragmentProcessor> fp;
if (applyPremulToSrc) {
- fp = this->createUPMToPMEffect(tempTextureProxy, tempDrawInfo.fSwizzle, SkMatrix::I());
+ fp = this->createUPMToPMEffect(tempProxy, tempDrawInfo.fSwizzle, SkMatrix::I());
// If premultiplying was the only reason for the draw, fall back to a straight write.
if (!fp) {
if (GrGpu::kCallerPrefersDraw_DrawPreference == drawPreference) {
- tempTextureProxy.reset(nullptr);
+ tempProxy.reset(nullptr);
}
} else {
applyPremulToSrc = false;
}
}
- if (tempTextureProxy) {
+ if (tempProxy) {
if (!fp) {
- fp = GrConfigConversionEffect::Make(this, tempTextureProxy, tempDrawInfo.fSwizzle,
+ fp = GrConfigConversionEffect::Make(this, tempProxy, tempDrawInfo.fSwizzle,
GrConfigConversionEffect::kNone_PMConversion,
SkMatrix::I());
if (!fp) {
return false;
}
}
- GrTexture* texture = tempTextureProxy->instantiate(this->textureProvider());
+ GrTexture* texture = tempProxy->instantiate(this->textureProvider());
if (!texture) {
return false;
}
}
}
}
- if (!tempTextureProxy) {
+ if (!tempProxy) {
if (applyPremulToSrc) {
size_t tmpRowBytes = 4 * width;
tmpPixels.reset(width * height);
SkBackingFit fit,
SkBudgeted isDstBudgeted) {
- sk_sp<GrSurfaceProxy> proxy = GrSurfaceProxy::MakeDeferred(fContext->textureProvider(),
+ sk_sp<GrTextureProxy> proxy = GrSurfaceProxy::MakeDeferred(fContext->textureProvider(),
*fContext->caps(), dstDesc,
fit, isDstBudgeted);
if (!proxy) {
desc.fConfig = config;
desc.fSampleCnt = sampleCnt;
- sk_sp<GrSurfaceProxy> rtp = GrSurfaceProxy::MakeDeferred(this->textureProvider(),
+ sk_sp<GrTextureProxy> rtp = GrSurfaceProxy::MakeDeferred(this->textureProvider(),
*this->caps(), desc, fit, budgeted);
if (!rtp) {
return nullptr;
#include "GrResourceProvider.h"
-sk_sp<GrSurfaceProxy> GrSurfaceProxy::MakeDeferred(GrTextureProvider* texProvider,
+sk_sp<GrTextureProxy> GrSurfaceProxy::MakeDeferred(GrTextureProvider* texProvider,
const GrCaps& caps,
const GrSurfaceDesc& desc,
SkBackingFit fit,
copyDesc.fSampleCnt = SkTMin(desc.fSampleCnt, caps.maxSampleCount());
#ifdef SK_DISABLE_DEFERRED_PROXIES
- sk_sp<GrSurface> surf;
+ sk_sp<GrTexture> tex;
if (SkBackingFit::kApprox == fit) {
- surf.reset(texProvider->createApproxTexture(copyDesc));
+ tex.reset(texProvider->createApproxTexture(copyDesc));
} else {
- surf.reset(texProvider->createTexture(copyDesc, budgeted));
+ tex.reset(texProvider->createTexture(copyDesc, budgeted));
}
- if (!surf) {
+ if (!tex) {
return nullptr;
}
- return GrSurfaceProxy::MakeWrapped(std::move(surf));
+ return GrSurfaceProxy::MakeWrapped(std::move(tex));
#else
if (willBeRT) {
// We know anything we instantiate later from this deferred path will be
// both texturable and renderable
- return sk_sp<GrSurfaceProxy>(new GrTextureRenderTargetProxy(caps, copyDesc, fit,
+ return sk_sp<GrTextureProxy>(new GrTextureRenderTargetProxy(caps, copyDesc, fit,
budgeted, flags));
}
- return sk_sp<GrSurfaceProxy>(new GrTextureProxy(copyDesc, fit, budgeted, nullptr, 0, flags));
+ return sk_sp<GrTextureProxy>(new GrTextureProxy(copyDesc, fit, budgeted, nullptr, 0, flags));
#endif
}
-sk_sp<GrSurfaceProxy> GrSurfaceProxy::MakeDeferred(const GrCaps& caps,
+sk_sp<GrTextureProxy> GrSurfaceProxy::MakeDeferred(const GrCaps& caps,
GrTextureProvider* texProvider,
const GrSurfaceDesc& desc,
SkBudgeted budgeted,
desc.fHeight = kSize;
desc.fConfig = kConfig;
- sk_sp<GrSurfaceProxy> dataProxy = GrSurfaceProxy::MakeDeferred(*context->caps(),
+ sk_sp<GrTextureProxy> dataProxy = GrSurfaceProxy::MakeDeferred(*context->caps(),
context->textureProvider(),
desc, SkBudgeted::kYes, data, 0);
- if (!dataProxy || !dataProxy->asTextureProxy()) {
+ if (!dataProxy) {
return;
}
GrPaint paint2;
GrPaint paint3;
sk_sp<GrFragmentProcessor> pmToUPM1(new GrConfigConversionEffect(
- context, sk_ref_sp(dataProxy->asTextureProxy()), GrSwizzle::RGBA(),
+ context, dataProxy, GrSwizzle::RGBA(),
*pmToUPMRule, SkMatrix::I()));
sk_sp<GrFragmentProcessor> upmToPM(new GrConfigConversionEffect(
context, readRTC->asTextureProxyRef(), GrSwizzle::RGBA(),
dstDesc.fOrigin = dOrigin;
dstDesc.fFlags = dFlags;
- sk_sp<GrSurfaceProxy> src(GrSurfaceProxy::MakeDeferred(
+ sk_sp<GrTextureProxy> src(GrSurfaceProxy::MakeDeferred(
*context->caps(),
context->textureProvider(),
srcDesc, SkBudgeted::kNo,
srcPixels.get(),
kRowBytes));
- sk_sp<GrSurfaceProxy> dst(GrSurfaceProxy::MakeDeferred(
+ sk_sp<GrTextureProxy> dst(GrSurfaceProxy::MakeDeferred(
*context->caps(),
context->textureProvider(),
dstDesc, SkBudgeted::kNo,
desc.fWidth = kFullSize;
desc.fHeight = kFullSize;
- sk_sp<GrSurfaceProxy> proxy = GrSurfaceProxy::MakeDeferred(*context->caps(),
- context->textureProvider(),
- desc, SkBudgeted::kYes,
- srcBM.getPixels(),
- srcBM.rowBytes());
- return sk_ref_sp(proxy->asTextureProxy());
+ return GrSurfaceProxy::MakeDeferred(*context->caps(),
+ context->textureProvider(),
+ desc, SkBudgeted::kYes,
+ srcBM.getPixels(),
+ srcBM.rowBytes());
}
}
// Test that we can create an integer texture.
- sk_sp<GrSurfaceProxy> proxy = GrSurfaceProxy::MakeDeferred(*context->caps(),
- context->textureProvider(),
- desc, SkBudgeted::kYes,
- testData.get(),
- kRowBytes);
+ sk_sp<GrTextureProxy> proxy = GrSurfaceProxy::MakeDeferred(*context->caps(),
+ context->textureProvider(),
+ desc, SkBudgeted::kYes,
+ testData.get(),
+ kRowBytes);
REPORTER_ASSERT(reporter, proxy);
- if (!proxy || !proxy->asTextureProxy()) {
+ if (!proxy) {
return;
}
- GrTexture* texture = proxy->asTextureProxy()->instantiate(context->textureProvider());
+ GrTexture* texture = proxy->instantiate(context->textureProvider());
REPORTER_ASSERT(reporter, texture);
if (!texture) {
return;
*writeCnt = resource->fPendingWrites;
}
-void testingOnly_getIORefCnts(GrSurfaceProxy* proxy, int* refCnt, int* readCnt, int* writeCnt) {
+void testingOnly_getIORefCnts(GrTextureProxy* proxy, int* refCnt, int* readCnt, int* writeCnt) {
*refCnt = proxy->getBackingRefCnt_TestOnly();
*readCnt = proxy->getPendingReadCnt_TestOnly();
*writeCnt = proxy->getPendingWriteCnt_TestOnly();
{
bool texelBufferSupport = context->caps()->shaderCaps()->texelBufferSupport();
bool imageLoadStoreSupport = context->caps()->shaderCaps()->imageLoadStoreSupport();
- sk_sp<GrSurfaceProxy> proxy1(GrSurfaceProxy::MakeDeferred(context->textureProvider(),
+ sk_sp<GrTextureProxy> proxy1(GrSurfaceProxy::MakeDeferred(context->textureProvider(),
*context->caps(), desc,
SkBackingFit::kExact,
SkBudgeted::kYes));
SkTArray<sk_sp<GrTextureProxy>> proxies;
SkTArray<sk_sp<GrBuffer>> buffers;
SkTArray<TestFP::Image> images;
- proxies.push_back(sk_ref_sp(proxy1->asTextureProxy()));
+ proxies.push_back(proxy1);
if (texelBufferSupport) {
buffers.push_back(buffer);
}
}
desc.fConfig = kRGBA_8888_GrPixelConfig;
- sk_sp<GrSurfaceProxy> dataProxy = GrSurfaceProxy::MakeDeferred(*context->caps(),
+ sk_sp<GrTextureProxy> dataProxy = GrSurfaceProxy::MakeDeferred(*context->caps(),
context->textureProvider(),
desc, SkBudgeted::kYes,
rgbaData.get(),
!fp->compatibleWithCoverageAsAlpha()) {
continue;
}
- test_draw_op(context, rtc.get(), fp, sk_ref_sp(dataProxy->asTextureProxy()));
+ test_draw_op(context, rtc.get(), fp, dataProxy);
memset(rgbaData.get(), 0x0, sizeof(GrColor) * 256 * 256);
rtc->readPixels(
SkImageInfo::Make(256, 256, kRGBA_8888_SkColorType, kPremul_SkAlphaType),
desc.fConfig = kRGBA_8888_GrPixelConfig;
{
- sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeDeferred(texProvider, caps, desc,
- SkBackingFit::kApprox,
- SkBudgeted::kYes));
+ sk_sp<GrTextureProxy> proxy(GrSurfaceProxy::MakeDeferred(texProvider, caps, desc,
+ SkBackingFit::kApprox,
+ SkBudgeted::kYes));
// Both RenderTarget and Texture
- GrRenderTargetProxy* rtProxy = sProxy->asRenderTargetProxy();
+ GrRenderTargetProxy* rtProxy = proxy->asRenderTargetProxy();
REPORTER_ASSERT(reporter, rtProxy);
GrTextureProxy* tProxy = rtProxy->asTextureProxy();
REPORTER_ASSERT(reporter, tProxy);
}
{
- sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeDeferred(texProvider, caps, desc,
- SkBackingFit::kApprox,
- SkBudgeted::kYes));
+ sk_sp<GrTextureProxy> proxy(GrSurfaceProxy::MakeDeferred(texProvider, caps, desc,
+ SkBackingFit::kApprox,
+ SkBudgeted::kYes));
// Both RenderTarget and Texture - but via GrTextureProxy
- GrTextureProxy* tProxy = sProxy->asTextureProxy();
+ GrTextureProxy* tProxy = proxy->asTextureProxy();
REPORTER_ASSERT(reporter, tProxy);
GrRenderTargetProxy* rtProxy = tProxy->asRenderTargetProxy();
REPORTER_ASSERT(reporter, rtProxy);
{
desc.fFlags = kNone_GrSurfaceFlags; // force no-RT
- sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeDeferred(texProvider, caps, desc,
- SkBackingFit::kApprox,
- SkBudgeted::kYes));
+ sk_sp<GrTextureProxy> proxy(GrSurfaceProxy::MakeDeferred(texProvider, caps, desc,
+ SkBackingFit::kApprox,
+ SkBudgeted::kYes));
// Texture-only
- GrTextureProxy* tProxy = sProxy->asTextureProxy();
+ GrTextureProxy* tProxy = proxy->asTextureProxy();
REPORTER_ASSERT(reporter, tProxy);
REPORTER_ASSERT(reporter, tProxy->asTextureProxy() == tProxy);
REPORTER_ASSERT(reporter, !tProxy->asRenderTargetProxy());
tex.reset(provider->createTexture(desc, budgeted));
}
- sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeDeferred(
+ sk_sp<GrTextureProxy> proxy(GrSurfaceProxy::MakeDeferred(
provider,
caps, desc,
fit, budgeted));
- REPORTER_ASSERT(reporter, SkToBool(tex) == SkToBool(sProxy));
- if (sProxy) {
- REPORTER_ASSERT(reporter, sProxy->asRenderTargetProxy());
+ REPORTER_ASSERT(reporter, SkToBool(tex) == SkToBool(proxy));
+ if (proxy) {
+ REPORTER_ASSERT(reporter, proxy->asRenderTargetProxy());
// This forces the proxy to compute and cache its
// pre-instantiation size guess. Later, when it is actually
// instantiated, it checks that the instantiated size is <= to
// the pre-computation. If the proxy never computed its
// pre-instantiation size then the check is skipped.
- sProxy->gpuMemorySize();
+ proxy->gpuMemorySize();
- check_surface(reporter, sProxy.get(), origin,
+ check_surface(reporter, proxy.get(), origin,
widthHeight, widthHeight, config,
kInvalidResourceID, budgeted);
check_rendertarget(reporter, caps, provider,
- sProxy->asRenderTargetProxy(),
+ proxy->asRenderTargetProxy(),
SkTMin(numSamples, caps.maxSampleCount()),
fit, caps.maxWindowRectangles(), false);
}
tex.reset(provider->createTexture(desc, budgeted));
}
- sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeDeferred(provider,
+ sk_sp<GrTextureProxy> proxy(GrSurfaceProxy::MakeDeferred(provider,
caps,
desc,
fit,
budgeted));
- REPORTER_ASSERT(reporter, SkToBool(tex) == SkToBool(sProxy));
- if (sProxy) {
+ REPORTER_ASSERT(reporter, SkToBool(tex) == SkToBool(proxy));
+ if (proxy) {
// This forces the proxy to compute and cache its pre-instantiation
// size guess. Later, when it is actually instantiated, it checks
// that the instantiated size is <= to the pre-computation.
// If the proxy never computed its pre-instantiation size then the
// check is skipped.
- sProxy->gpuMemorySize();
+ proxy->gpuMemorySize();
- check_surface(reporter, sProxy.get(), origin,
+ check_surface(reporter, proxy.get(), origin,
widthHeight, widthHeight, config,
kInvalidResourceID, budgeted);
- check_texture(reporter, provider, sProxy->asTextureProxy(),
+ check_texture(reporter, provider, proxy->asTextureProxy(),
fit, false);
}
}
// We are initializing the texture with zeros here
memset(alphaData, 0, X_SIZE * Y_SIZE);
- sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeDeferred(*context->caps(),
- context->textureProvider(),
- desc,
- SkBudgeted::kNo,
- alphaData, 0));
- if (!sProxy) {
+ sk_sp<GrTextureProxy> proxy(GrSurfaceProxy::MakeDeferred(*context->caps(),
+ context->textureProvider(),
+ desc,
+ SkBudgeted::kNo,
+ alphaData, 0));
+ if (!proxy) {
ERRORF(reporter, "Could not create alpha texture.");
return;
}
sk_sp<GrSurfaceContext> sContext(context->contextPriv().makeWrappedSurfaceContext(
- sProxy, nullptr));
+ std::move(proxy), nullptr));
const SkImageInfo ii = SkImageInfo::MakeA8(X_SIZE, Y_SIZE);
sk_sp<SkSurface> surf(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, ii));
desc.fHeight = texS;
GrTextureProvider* texProvider = context->textureProvider();
- sk_sp<GrSurfaceProxy> proxy = GrSurfaceProxy::MakeDeferred(*context->caps(), texProvider,
+ sk_sp<GrTextureProxy> proxy = GrSurfaceProxy::MakeDeferred(*context->caps(), texProvider,
desc, SkBudgeted::kNo,
texData, 0);
GrPaint paint;
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
GrSamplerParams mipMapParams(SkShader::kRepeat_TileMode, GrSamplerParams::kMipMap_FilterMode);
- paint.addColorTextureProcessor(context, sk_ref_sp(proxy->asTextureProxy()),
+ paint.addColorTextureProcessor(context, std::move(proxy),
nullptr, SkMatrix::MakeScale(rtS), mipMapParams);
// 1) Draw texture to S32 surface (should generate/use sRGB mips)
// gpu
const GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bm.info(), *context->caps());
- sk_sp<GrSurfaceProxy> proxy(GrSurfaceProxy::MakeDeferred(*context->caps(),
+ sk_sp<GrTextureProxy> proxy(GrSurfaceProxy::MakeDeferred(*context->caps(),
context->textureProvider(),
desc, SkBudgeted::kNo,
bm.getPixels(), bm.rowBytes()));
- if (!proxy || !proxy->asTextureProxy()) {
+ if (!proxy) {
return;
}
sk_sp<SkSpecialImage> gpuImage(SkSpecialImage::MakeDeferredFromGpu(
- context,
- SkIRect::MakeWH(kFullSize,
- kFullSize),
- kNeedNewImageUniqueID_SpecialImage,
- sk_ref_sp(proxy->asTextureProxy()),
- nullptr));
+ context,
+ SkIRect::MakeWH(kFullSize, kFullSize),
+ kNeedNewImageUniqueID_SpecialImage,
+ std::move(proxy), nullptr));
{
sk_sp<SkSpecialImage> fromGPU(gpuImage->makeTextureImage(context));
const GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bm.info(), *context->caps());
- sk_sp<GrSurfaceProxy> proxy(GrSurfaceProxy::MakeDeferred(*context->caps(),
+ sk_sp<GrTextureProxy> proxy(GrSurfaceProxy::MakeDeferred(*context->caps(),
context->textureProvider(),
desc, SkBudgeted::kNo,
bm.getPixels(), bm.rowBytes()));
- if (!proxy || !proxy->asTextureProxy()) {
+ if (!proxy) {
return;
}
context,
SkIRect::MakeWH(kFullSize, kFullSize),
kNeedNewImageUniqueID_SpecialImage,
- sk_ref_sp(proxy->asTextureProxy()),
- nullptr));
+ proxy, nullptr));
const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize);
{
sk_sp<SkSpecialImage> subSImg1(SkSpecialImage::MakeDeferredFromGpu(
- context,
- subset,
+ context, subset,
kNeedNewImageUniqueID_SpecialImage,
- sk_ref_sp(proxy->asTextureProxy()),
- nullptr));
+ std::move(proxy), nullptr));
test_image(subSImg1, reporter, context, true, kPad, kFullSize);
}
desc.fWidth = kFullSize;
desc.fHeight = kFullSize;
- sk_sp<GrSurfaceProxy> proxy(GrSurfaceProxy::MakeDeferred(*context->caps(),
+ sk_sp<GrTextureProxy> proxy(GrSurfaceProxy::MakeDeferred(*context->caps(),
context->textureProvider(),
desc, SkBudgeted::kNo,
bm.getPixels(), 0));
context,
SkIRect::MakeWH(kFullSize, kFullSize),
kNeedNewImageUniqueID_SpecialImage,
- sk_ref_sp(proxy->asTextureProxy()),
- nullptr));
+ proxy, nullptr));
const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize);
{
sk_sp<SkSpecialImage> subSImg1(SkSpecialImage::MakeDeferredFromGpu(
- context,
- subset,
+ context, subset,
kNeedNewImageUniqueID_SpecialImage,
- sk_ref_sp(proxy->asTextureProxy()),
- nullptr));
+ std::move(proxy), nullptr));
test_image(subSImg1, reporter, context, true, kPad, kFullSize);
}
for (auto flags : { kNone_GrSurfaceFlags, kRenderTarget_GrSurfaceFlag }) {
copySrcDesc.fFlags = flags;
- sk_sp<GrSurfaceProxy> src(GrSurfaceProxy::MakeDeferred(*context->caps(),
+ sk_sp<GrTextureProxy> src(GrSurfaceProxy::MakeDeferred(*context->caps(),
context->textureProvider(),
copySrcDesc,
SkBudgeted::kYes, pixels.get(), 0));