aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ApplyGammaTest.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-07-29 08:28:25 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-29 08:28:25 -0700
commit1e8761809d76429961dac92f874e7e0a36a0e5c4 (patch)
tree5fb8bd7c07785628d0bdacda909fbc36bc95fc9a /tests/ApplyGammaTest.cpp
parente0d362929d6569e8737d80dead791c640390e819 (diff)
Remove GrContext::applyGamma
Diffstat (limited to 'tests/ApplyGammaTest.cpp')
-rw-r--r--tests/ApplyGammaTest.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/tests/ApplyGammaTest.cpp b/tests/ApplyGammaTest.cpp
index 8db8fe09f6..6e6e23a9ae 100644
--- a/tests/ApplyGammaTest.cpp
+++ b/tests/ApplyGammaTest.cpp
@@ -10,11 +10,9 @@
#if SK_SUPPORT_GPU
#include "GrContext.h"
-#include "GrDrawContext.h"
-#include "GrTexture.h"
-#include "GrTextureProvider.h"
#include "SkCanvas.h"
+#include "SkGammaColorFilter.h"
#include "SkPixmap.h"
#include "SkSurface.h"
#include "SkUtils.h"
@@ -113,20 +111,12 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ApplyGamma, reporter, ctxInfo) {
dstCanvas->clear(SK_ColorRED);
dstCanvas->flush();
- // Temporary code until applyGamma is replaced
- GrDrawContext* dc = dstCanvas->internal_private_accessTopLayerDrawContext();
- GrRenderTarget* rt = dc->accessRenderTarget();
- GrTexture* texture = src->getTexture();
- SkASSERT(texture);
+ SkPaint gammaPaint;
+ gammaPaint.setXfermodeMode(SkXfermode::kSrc_Mode);
+ gammaPaint.setColorFilter(SkGammaColorFilter::Make(gamma));
- bool result = context->applyGamma(rt, texture, gamma);
-
- // To make the copied src rect correct we would apply any dst clipping
- // back to the src rect, but we don't use it again so don't bother.
- if (!result) {
- ERRORF(reporter, "Unexpected failure from applyGamma.");
- continue;
- }
+ dstCanvas->drawImage(src, 0, 0, &gammaPaint);
+ dstCanvas->flush();
sk_memset32(read.get(), 0, kW * kH);
if (!dstCanvas->readPixels(ii, read.get(), kRowBytes, 0, 0)) {