aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ApplyGammaTest.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-01-17 10:06:20 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-17 16:44:42 +0000
commit3f142b6a785ab7af64383fccf98ae2528cdd71e3 (patch)
tree425d1bb18f27432d625a0ec46e26bdabb5630a3e /tests/ApplyGammaTest.cpp
parentcb6266b5aa5bbfd880532f08eec83b0c585e873f (diff)
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>
Diffstat (limited to 'tests/ApplyGammaTest.cpp')
-rw-r--r--tests/ApplyGammaTest.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/ApplyGammaTest.cpp b/tests/ApplyGammaTest.cpp
index ec790f5280..4f1f828966 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ApplyGamma, reporter, ctxInfo) {
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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ApplyGamma, reporter, ctxInfo) {
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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ApplyGamma, reporter, ctxInfo) {
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);