Replace some GrSurface:read/writePixels with the GrSurfaceContext equivalent
Change-Id: I7b11a323b0c74ee70f52b1bd8be376fb7188cb19
Reviewed-on: https://skia-review.googlesource.com/7204
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 8405fcb..46afb9f 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -185,6 +185,9 @@
}
}
+ const SkImageInfo ii = SkImageInfo::Make(kSize, kSize,
+ kRGBA_8888_SkColorType, kPremul_SkAlphaType);
+
sk_sp<GrRenderTargetContext> readRTC(context->makeRenderTargetContext(SkBackingFit::kExact,
kSize, kSize,
kConfig, nullptr));
@@ -240,7 +243,9 @@
readRTC->fillRectToRect(GrNoClip(), std::move(paint1), GrAA::kNo, SkMatrix::I(), kDstRect,
kSrcRect);
- readRTC->asTexture()->readPixels(0, 0, kSize, kSize, kConfig, firstRead);
+ if (!readRTC->readPixels(ii, firstRead, 0, 0, 0)) {
+ continue;
+ }
paint2.addColorFragmentProcessor(std::move(upmToPM));
paint2.setPorterDuffXPFactory(SkBlendMode::kSrc);
@@ -254,7 +259,9 @@
readRTC->fillRectToRect(GrNoClip(), std::move(paint3), GrAA::kNo, SkMatrix::I(), kDstRect,
kSrcRect);
- readRTC->asTexture()->readPixels(0, 0, kSize, kSize, kConfig, secondRead);
+ if (!readRTC->readPixels(ii, secondRead, 0, 0, 0)) {
+ continue;
+ }
failed = false;
for (int y = 0; y < kSize && !failed; ++y) {