aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-11-13 12:47:24 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-13 18:15:10 +0000
commite0070c0e92cebaa716dd71e9eb363bb05619c408 (patch)
tree2dd7c0667cb2ab1ef277b03a2cac96c192bc7630 /tests
parentb251b72d3d91fb7976f7984ae60793c87d0dae4c (diff)
Patch up ref counting of proxies (take 2)
TBR=bsalomon@google.com Change-Id: I2376c6b17ac7c2b28837bafb76583934ab72558e Reviewed-on: https://skia-review.googlesource.com/70501 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/GrMipMappedTest.cpp6
-rw-r--r--tests/OnFlushCallbackTest.cpp12
2 files changed, 7 insertions, 11 deletions
diff --git a/tests/GrMipMappedTest.cpp b/tests/GrMipMappedTest.cpp
index f023018902..c2a0df2e5d 100644
--- a/tests/GrMipMappedTest.cpp
+++ b/tests/GrMipMappedTest.cpp
@@ -53,7 +53,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrWrappedMipMappedTest, reporter, ctxInfo) {
mipMapped,
backendHandle);
- GrTextureProxy* proxy;
+ sk_sp<GrTextureProxy> proxy;
sk_sp<SkImage> image;
if (isRT) {
sk_sp<SkSurface> surface = SkSurface::MakeFromBackendTexture(
@@ -65,12 +65,12 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrWrappedMipMappedTest, reporter, ctxInfo) {
nullptr);
SkGpuDevice* device = ((SkSurface_Gpu*)surface.get())->getDevice();
- proxy = device->accessRenderTargetContext()->asTextureProxy();
+ proxy = device->accessRenderTargetContext()->asTextureProxyRef();
} else {
image = SkImage::MakeFromTexture(context, backendTex,
kTopLeft_GrSurfaceOrigin,
kPremul_SkAlphaType, nullptr);
- proxy = as_IB(image)->peekProxy();
+ proxy = as_IB(image)->asTextureProxyRef();
}
REPORTER_ASSERT(reporter, proxy);
if (!proxy) {
diff --git a/tests/OnFlushCallbackTest.cpp b/tests/OnFlushCallbackTest.cpp
index 0c2edfba43..c7af59ac9f 100644
--- a/tests/OnFlushCallbackTest.cpp
+++ b/tests/OnFlushCallbackTest.cpp
@@ -415,8 +415,6 @@ static sk_sp<GrTextureProxy> make_upstream_image(GrContext* context, AtlasObject
for (int i = 0; i < 3; ++i) {
SkRect r = SkRect::MakeXYWH(i*kDrawnTileSize, 0, kDrawnTileSize, kDrawnTileSize);
- // TODO: here is the blocker for deferring creation of the atlas. The TextureSamplers
- // created here currently require a hard GrTexture.
auto fp = GrSimpleTextureEffect::Make(fakeAtlas, SkMatrix::I());
GrPaint paint;
paint.addColorFragmentProcessor(std::move(fp));
@@ -481,12 +479,10 @@ sk_sp<GrTextureProxy> pre_create_atlas(GrContext* context) {
desc.fWidth = 32;
desc.fHeight = 16;
desc.fConfig = kSkia8888_GrPixelConfig;
- sk_sp<GrSurfaceProxy> atlasDest = GrSurfaceProxy::MakeDeferred(
- context->resourceProvider(),
- desc, SkBackingFit::kExact,
- SkBudgeted::kYes,
- GrResourceProvider::kNoPendingIO_Flag);
- return sk_ref_sp(atlasDest->asTextureProxy());
+ return GrSurfaceProxy::MakeDeferred(context->resourceProvider(),
+ desc, SkBackingFit::kExact,
+ SkBudgeted::kYes,
+ GrResourceProvider::kNoPendingIO_Flag);
}
#endif