| 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 12 matching lines...) Expand all Loading... |
| 23 } | 23 } |
| 24 GrContext* context = factory->get(glType); | 24 GrContext* context = factory->get(glType); |
| 25 if (NULL == context) { | 25 if (NULL == context) { |
| 26 continue; | 26 continue; |
| 27 } | 27 } |
| 28 | 28 |
| 29 unsigned char textureData[X_SIZE][Y_SIZE]; | 29 unsigned char textureData[X_SIZE][Y_SIZE]; |
| 30 | 30 |
| 31 memset(textureData, 0, X_SIZE * Y_SIZE); | 31 memset(textureData, 0, X_SIZE * Y_SIZE); |
| 32 | 32 |
| 33 GrTextureDesc desc; | 33 GrSurfaceDesc desc; |
| 34 | 34 |
| 35 // let Skia know we will be using this texture as a render target | 35 // let Skia know we will be using this texture as a render target |
| 36 desc.fFlags = kRenderTarget_GrTextureFlagBit; | 36 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
| 37 // it is a single channel texture | 37 // it is a single channel texture |
| 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 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 match = false; | 104 match = false; |
| 105 } | 105 } |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 REPORTER_ASSERT(reporter, match); | 109 REPORTER_ASSERT(reporter, match); |
| 110 } | 110 } |
| 111 } | 111 } |
| 112 | 112 |
| 113 #endif | 113 #endif |
| OLD | NEW |