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

Side by Side Diff: tests/ReadWriteAlphaTest.cpp

Issue 1525193002: Set GL_PACK_ALIGNMENT before calling glReadPixels (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 | « src/gpu/gl/GrGLGpu.cpp ('k') | no next file » | 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 2012 Google Inc. 2 * Copyright 2012 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 9
10 // This test is specific to the GPU backend. 10 // This test is specific to the GPU backend.
11 #if SK_SUPPORT_GPU && !defined(SK_BUILD_FOR_ANDROID) 11 #if SK_SUPPORT_GPU && !defined(SK_BUILD_FOR_ANDROID)
12 12
13 #include "GrContext.h" 13 #include "GrContext.h"
14 #include "SkGpuDevice.h" 14 #include "SkGpuDevice.h"
15 15
16 static const int X_SIZE = 12; 16 // This was made indivisible by 4 to ensure we test setting GL_PACK_ALIGNMENT pr operly.
17 static const int Y_SIZE = 12; 17 static const int X_SIZE = 13;
18 static const int Y_SIZE = 13;
18 19
19 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, context) { 20 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, context) {
20 unsigned char textureData[X_SIZE][Y_SIZE]; 21 unsigned char textureData[X_SIZE][Y_SIZE];
21 22
22 memset(textureData, 0, X_SIZE * Y_SIZE); 23 memset(textureData, 0, X_SIZE * Y_SIZE);
23 24
24 GrSurfaceDesc desc; 25 GrSurfaceDesc desc;
25 26
26 // let Skia know we will be using this texture as a render target 27 // let Skia know we will be using this texture as a render target
27 desc.fFlags = kRenderTarget_GrSurfaceFlag; 28 desc.fFlags = kRenderTarget_GrSurfaceFlag;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 if (0xFF != readback[x][y]) { 96 if (0xFF != readback[x][y]) {
96 match = false; 97 match = false;
97 } 98 }
98 } 99 }
99 } 100 }
100 101
101 REPORTER_ASSERT(reporter, match); 102 REPORTER_ASSERT(reporter, match);
102 } 103 }
103 104
104 #endif 105 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698