Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: tests/SRGBMipMapTest.cpp

Issue 2215323003: Start using RenderTargetProxy (omnibus) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/ClearTest.cpp ('k') | tests/SurfaceTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « tests/ClearTest.cpp ('k') | tests/SurfaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698