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 // This test is specific to the GPU backend. | 8 // This test is specific to the GPU backend. |
9 #if SK_SUPPORT_GPU && !defined(SK_BUILD_FOR_ANDROID) | 9 #if SK_SUPPORT_GPU && !defined(SK_BUILD_FOR_ANDROID) |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 desc.fConfig = kAlpha_8_GrPixelConfig; | 38 desc.fConfig = kAlpha_8_GrPixelConfig; |
39 desc.fWidth = X_SIZE; | 39 desc.fWidth = X_SIZE; |
40 desc.fHeight = Y_SIZE; | 40 desc.fHeight = Y_SIZE; |
41 | 41 |
42 // We are initializing the texture with zeros here | 42 // We are initializing the texture with zeros here |
43 GrTexture* texture = context->createUncachedTexture(desc, textureData, 0
); | 43 GrTexture* texture = context->createUncachedTexture(desc, textureData, 0
); |
44 if (!texture) { | 44 if (!texture) { |
45 return; | 45 return; |
46 } | 46 } |
47 | 47 |
48 SkAutoUnref au(texture); | 48 SkAutoTUnref<GrTexture> au(texture); |
49 | 49 |
50 // create a distinctive texture | 50 // create a distinctive texture |
51 for (int y = 0; y < Y_SIZE; ++y) { | 51 for (int y = 0; y < Y_SIZE; ++y) { |
52 for (int x = 0; x < X_SIZE; ++x) { | 52 for (int x = 0; x < X_SIZE; ++x) { |
53 textureData[x][y] = x*Y_SIZE+y; | 53 textureData[x][y] = x*Y_SIZE+y; |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 // upload the texture | 57 // upload the texture |
58 texture->writePixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig, | 58 texture->writePixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 match = false; | 103 match = false; |
104 } | 104 } |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 REPORTER_ASSERT(reporter, match); | 108 REPORTER_ASSERT(reporter, match); |
109 } | 109 } |
110 } | 110 } |
111 | 111 |
112 #endif | 112 #endif |
OLD | NEW |