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

Side by Side Diff: tests/EGLImageTest.cpp

Issue 1734043002: Revert of Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « tests/CopySurfaceTest.cpp ('k') | tests/FloatingPointTextureTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Test.h" 8 #include "Test.h"
9 #if SK_SUPPORT_GPU 9 #if SK_SUPPORT_GPU
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 " texture."); 66 " texture.");
67 } 67 }
68 68
69 static void test_copy_surface(skiatest::Reporter* reporter, GrContext* context, 69 static void test_copy_surface(skiatest::Reporter* reporter, GrContext* context,
70 GrTexture* externalTexture, uint32_t expectedPixel Values[]) { 70 GrTexture* externalTexture, uint32_t expectedPixel Values[]) {
71 GrSurfaceDesc copyDesc; 71 GrSurfaceDesc copyDesc;
72 copyDesc.fConfig = kRGBA_8888_GrPixelConfig; 72 copyDesc.fConfig = kRGBA_8888_GrPixelConfig;
73 copyDesc.fWidth = externalTexture->width(); 73 copyDesc.fWidth = externalTexture->width();
74 copyDesc.fHeight = externalTexture->height(); 74 copyDesc.fHeight = externalTexture->height();
75 copyDesc.fFlags = kRenderTarget_GrSurfaceFlag; 75 copyDesc.fFlags = kRenderTarget_GrSurfaceFlag;
76 SkAutoTUnref<GrTexture> copy(context->textureProvider()->createTexture( 76 SkAutoTUnref<GrTexture> copy(context->textureProvider()->createTexture(copyD esc, true));
77 copyDesc, SkBudgeted::kYes));
78 context->copySurface(copy, externalTexture); 77 context->copySurface(copy, externalTexture);
79 test_read_pixels(reporter, context, copy, expectedPixelValues); 78 test_read_pixels(reporter, context, copy, expectedPixelValues);
80 } 79 }
81 80
82 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(EGLImageTest, reporter, context0, glCtx0) { 81 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(EGLImageTest, reporter, context0, glCtx0) {
83 // Try to create a second GL context and then check if the contexts have nec essary 82 // Try to create a second GL context and then check if the contexts have nec essary
84 // extensions to run this test. 83 // extensions to run this test.
85 84
86 if (kGLES_GrGLStandard != glCtx0->gl()->fStandard) { 85 if (kGLES_GrGLStandard != glCtx0->gl()->fStandard) {
87 return; 86 return;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 test_read_pixels(reporter, context0, externalTextureObj, pixels.get()); 196 test_read_pixels(reporter, context0, externalTextureObj, pixels.get());
198 197
199 test_write_pixels(reporter, context0, externalTextureObj); 198 test_write_pixels(reporter, context0, externalTextureObj);
200 199
201 test_copy_surface(reporter, context0, externalTextureObj, pixels.get()); 200 test_copy_surface(reporter, context0, externalTextureObj, pixels.get());
202 201
203 cleanup(glCtx0, externalTexture.fID, glCtx1, context1, backendTexture1, imag e); 202 cleanup(glCtx0, externalTexture.fID, glCtx1, context1, backendTexture1, imag e);
204 } 203 }
205 204
206 #endif 205 #endif
OLDNEW
« no previous file with comments | « tests/CopySurfaceTest.cpp ('k') | tests/FloatingPointTextureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698