OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 /* | 8 /* |
9 * This is a straightforward test of floating point textures, which are | 9 * This is a straightforward test of floating point textures, which are |
10 * supported on some platforms. As of right now, this test only supports | 10 * supported on some platforms. As of right now, this test only supports |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 SkAutoTUnref<GrTexture> fpTexture(context->createUncachedTexture(des
c, | 61 SkAutoTUnref<GrTexture> fpTexture(context->createUncachedTexture(des
c, |
62 NUL
L, | 62 NUL
L, |
63 0))
; | 63 0))
; |
64 | 64 |
65 // Floating point textures are NOT supported everywhere | 65 // Floating point textures are NOT supported everywhere |
66 if (NULL == fpTexture) { | 66 if (NULL == fpTexture) { |
67 continue; | 67 continue; |
68 } | 68 } |
69 | 69 |
70 // write square | 70 // write square |
71 context->writeTexturePixels(fpTexture, 0, 0, DEV_W, DEV_H, desc.fCon
fig, | 71 fpTexture->writePixels(0, 0, DEV_W, DEV_H, desc.fConfig, controlPixe
lData, 0); |
72 controlPixelData, 0); | 72 fpTexture->readPixels(0, 0, DEV_W, DEV_H, desc.fConfig, readBuffer,
0); |
73 context->readTexturePixels(fpTexture, 0, 0, DEV_W, DEV_H, desc.fConf
ig, readBuffer, 0); | |
74 for (int j = 0; j < FP_CONTROL_ARRAY_SIZE; ++j) { | 73 for (int j = 0; j < FP_CONTROL_ARRAY_SIZE; ++j) { |
75 REPORTER_ASSERT(reporter, readBuffer[j] == controlPixelData[j]); | 74 REPORTER_ASSERT(reporter, readBuffer[j] == controlPixelData[j]); |
76 } | 75 } |
77 } | 76 } |
78 } | 77 } |
79 } | 78 } |
80 | 79 |
81 #endif | 80 #endif |
OLD | NEW |