Remove (most) usage of MakeTextureFromPixmap
Planning to remove this API entirely, as it's not really needed. There is
one remaining call-site that requires a bigger change, so I want to land
these first.
BUG=skia:
Change-Id: I6c6ae88202291c4896c1ba8f47824596ac8a150f
Reviewed-on: https://skia-review.googlesource.com/7105
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/tests/ApplyGammaTest.cpp b/tests/ApplyGammaTest.cpp
index ec790f5..4f1f828 100644
--- a/tests/ApplyGammaTest.cpp
+++ b/tests/ApplyGammaTest.cpp
@@ -13,7 +13,6 @@
#include "SkCanvas.h"
#include "SkGammaColorFilter.h"
-#include "SkPixmap.h"
#include "SkSurface.h"
#include "SkUtils.h"
@@ -87,7 +86,8 @@
srcPixels.get()[i] = i;
}
- SkPixmap pm(ii, srcPixels.get(), kRowBytes);
+ SkBitmap bm;
+ bm.installPixels(ii, srcPixels.get(), kRowBytes);
SkAutoTMalloc<uint32_t> read(kW * kH);
@@ -96,12 +96,10 @@
for (auto dOrigin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin }) {
for (auto gamma : { 1.0f, 1.0f / 1.8f, 1.0f / 2.2f }) {
- sk_sp<SkImage> src(SkImage::MakeTextureFromPixmap(context, pm, SkBudgeted::kNo));
-
sk_sp<SkSurface> dst(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo,
ii, 0, dOrigin, nullptr));
- if (!src || !dst) {
+ if (!dst) {
ERRORF(reporter, "Could not create surfaces for copy surface test.");
continue;
}
@@ -115,7 +113,7 @@
gammaPaint.setBlendMode(SkBlendMode::kSrc);
gammaPaint.setColorFilter(SkGammaColorFilter::Make(gamma));
- dstCanvas->drawImage(src, 0, 0, &gammaPaint);
+ dstCanvas->drawBitmap(bm, 0, 0, &gammaPaint);
dstCanvas->flush();
sk_memset32(read.get(), 0, kW * kH);