| Index: tests/SRGBMipMapTest.cpp
|
| diff --git a/tests/SRGBMipMapTest.cpp b/tests/SRGBMipMapTest.cpp
|
| index 4261796001f897f82687931323404bbdb6bade7e..5d2a26c212510a83100d8846ba7f4049f40b7491 100644
|
| --- a/tests/SRGBMipMapTest.cpp
|
| +++ b/tests/SRGBMipMapTest.cpp
|
| @@ -10,6 +10,8 @@
|
| #include "GrCaps.h"
|
| #include "GrContext.h"
|
| #include "GrRenderTargetContext.h"
|
| +#include "GrTextureProxy.h"
|
| +
|
| #include "SkCanvas.h"
|
| #include "SkSurface.h"
|
|
|
| @@ -42,13 +44,13 @@ static bool check_value(U8CPU value, U8CPU expected, U8CPU error) {
|
| }
|
| }
|
|
|
| -void read_and_check_pixels(skiatest::Reporter* reporter, GrTexture* texture, U8CPU expected,
|
| +void read_and_check_pixels(skiatest::Reporter* reporter, GrTextureProxy* texture, U8CPU expected,
|
| U8CPU error, const char* subtestName) {
|
| int w = texture->width();
|
| int h = texture->height();
|
| SkAutoTMalloc<uint32_t> readData(w * h);
|
| memset(readData.get(), 0, sizeof(uint32_t) * w * h);
|
| - if (!texture->readPixels(0, 0, w, h, texture->config(), readData.get())) {
|
| + if (!texture->readPixels2(0, 0, w, h, texture->config(), readData.get())) {
|
| ERRORF(reporter, "Could not read pixels for %s.", subtestName);
|
| return;
|
| }
|
| @@ -136,19 +138,19 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SRGBMipMaps, reporter, ctxInfo) {
|
| // 1) Draw texture to S32 surface (should generate/use sRGB mips)
|
| paint.setGammaCorrect(true);
|
| s32RenderTargetContext->drawRect(noClip, paint, SkMatrix::I(), rect);
|
| - read_and_check_pixels(reporter, s32RenderTargetContext->asTexture().get(), expectedSRGB, error,
|
| + read_and_check_pixels(reporter, s32RenderTargetContext->asDeferredTexture().get(), expectedSRGB, error,
|
| "first render of sRGB");
|
|
|
| // 2) Draw texture to L32 surface (should generate/use linear mips)
|
| paint.setGammaCorrect(false);
|
| l32RenderTargetContext->drawRect(noClip, paint, SkMatrix::I(), rect);
|
| - read_and_check_pixels(reporter, l32RenderTargetContext->asTexture().get(), expectedLinear,
|
| + read_and_check_pixels(reporter, l32RenderTargetContext->asDeferredTexture().get(), expectedLinear,
|
| error, "re-render as linear");
|
|
|
| // 3) Go back to sRGB
|
| paint.setGammaCorrect(true);
|
| s32RenderTargetContext->drawRect(noClip, paint, SkMatrix::I(), rect);
|
| - read_and_check_pixels(reporter, s32RenderTargetContext->asTexture().get(), expectedSRGB, error,
|
| + read_and_check_pixels(reporter, s32RenderTargetContext->asDeferredTexture().get(), expectedSRGB, error,
|
| "re-render as sRGB");
|
| }
|
| #endif
|
|
|