From 1e8761809d76429961dac92f874e7e0a36a0e5c4 Mon Sep 17 00:00:00 2001 From: robertphillips Date: Fri, 29 Jul 2016 08:28:25 -0700 Subject: Remove GrContext::applyGamma GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2191323002 Review-Url: https://codereview.chromium.org/2191323002 --- tests/ApplyGammaTest.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'tests/ApplyGammaTest.cpp') 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)) { -- cgit v1.2.3