Remove SkSpecialImage's GrTexture-based ctors
Change-Id: Id71b8ab0477cd1d459089d97af27d63f9f08d21b
Reviewed-on: https://skia-review.googlesource.com/7889
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/tests/ImageFilterCacheTest.cpp b/tests/ImageFilterCacheTest.cpp
index 393269a..d2d543c 100644
--- a/tests/ImageFilterCacheTest.cpp
+++ b/tests/ImageFilterCacheTest.cpp
@@ -192,6 +192,24 @@
return context->textureProvider()->createTexture(desc, SkBudgeted::kNo, srcBM.getPixels(), 0);
}
+static sk_sp<GrTextureProxy> create_proxy(GrContext* context) {
+ SkBitmap srcBM = create_bm();
+
+ GrSurfaceDesc desc;
+ desc.fConfig = kRGBA_8888_GrPixelConfig;
+ desc.fFlags = kNone_GrSurfaceFlags;
+ 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());
+}
+
+
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterCache_ImageBackedGPU, reporter, ctxInfo) {
sk_sp<GrTexture> srcTexture(create_texture(ctxInfo.grContext()));
if (!srcTexture) {
@@ -234,23 +252,26 @@
}
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterCache_GPUBacked, reporter, ctxInfo) {
+ GrContext* context = ctxInfo.grContext();
- sk_sp<GrTexture> srcTexture(create_texture(ctxInfo.grContext()));
- if (!srcTexture) {
+ sk_sp<GrTextureProxy> srcProxy(create_proxy(context));
+ if (!srcProxy) {
return;
}
const SkIRect& full = SkIRect::MakeWH(kFullSize, kFullSize);
- sk_sp<SkSpecialImage> fullImg(SkSpecialImage::MakeFromGpu(full,
+ sk_sp<SkSpecialImage> fullImg(SkSpecialImage::MakeDeferredFromGpu(
+ context, full,
kNeedNewImageUniqueID_SpecialImage,
- srcTexture, nullptr));
+ srcProxy, nullptr));
const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize);
- sk_sp<SkSpecialImage> subsetImg(SkSpecialImage::MakeFromGpu(subset,
+ sk_sp<SkSpecialImage> subsetImg(SkSpecialImage::MakeDeferredFromGpu(
+ context, subset,
kNeedNewImageUniqueID_SpecialImage,
- srcTexture, nullptr));
+ srcProxy, nullptr));
test_find_existing(reporter, fullImg, subsetImg);
test_dont_find_if_diff_key(reporter, fullImg, subsetImg);