OLD | NEW |
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 Loading... |
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 |
OLD | NEW |