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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 GrContextFactory::GLContextType type = | 52 GrContextFactory::GLContextType type = |
53 static_cast<GrContextFactory::GLContextType>(glCtxType); | 53 static_cast<GrContextFactory::GLContextType>(glCtxType); |
54 if (!GrContextFactory::IsRenderingGLContext(type)) { | 54 if (!GrContextFactory::IsRenderingGLContext(type)) { |
55 continue; | 55 continue; |
56 } | 56 } |
57 GrContext* context = factory->get(type); | 57 GrContext* context = factory->get(type); |
58 if (NULL == context){ | 58 if (NULL == context){ |
59 continue; | 59 continue; |
60 } | 60 } |
61 | 61 |
62 SkAutoTUnref<GrTexture> fpTexture( | 62 SkAutoTUnref<GrTexture> fpTexture(context->createTexture(desc, false
, |
63 context->createUncachedTexture(desc, controlPixelData.begin(
), 0)); | 63 controlPixe
lData.begin(), 0)); |
64 // Floating point textures are NOT supported everywhere | 64 // Floating point textures are NOT supported everywhere |
65 if (NULL == fpTexture) { | 65 if (NULL == fpTexture) { |
66 continue; | 66 continue; |
67 } | 67 } |
68 fpTexture->readPixels(0, 0, DEV_W, DEV_H, desc.fConfig, readBuffer.b
egin(), 0); | 68 fpTexture->readPixels(0, 0, DEV_W, DEV_H, desc.fConfig, readBuffer.b
egin(), 0); |
69 REPORTER_ASSERT(reporter, | 69 REPORTER_ASSERT(reporter, |
70 0 == memcmp(readBuffer.begin(), controlPixelData.begin(), re
adBuffer.bytes())); | 70 0 == memcmp(readBuffer.begin(), controlPixelData.begin(), re
adBuffer.bytes())); |
71 } | 71 } |
72 } | 72 } |
73 } | 73 } |
(...skipping 25 matching lines...) Expand all Loading... |
99 GrContextFactory::GLContextType type = | 99 GrContextFactory::GLContextType type = |
100 static_cast<GrContextFactory::GLContextType>(glCtxType); | 100 static_cast<GrContextFactory::GLContextType>(glCtxType); |
101 if (!GrContextFactory::IsRenderingGLContext(type)) { | 101 if (!GrContextFactory::IsRenderingGLContext(type)) { |
102 continue; | 102 continue; |
103 } | 103 } |
104 GrContext* context = factory->get(type); | 104 GrContext* context = factory->get(type); |
105 if (NULL == context){ | 105 if (NULL == context){ |
106 continue; | 106 continue; |
107 } | 107 } |
108 | 108 |
109 SkAutoTUnref<GrTexture> fpTexture( | 109 SkAutoTUnref<GrTexture> fpTexture(context->createTexture(desc, false
, |
110 context->createUncachedTexture(desc, controlPixelData.begin(
), 0)); | 110 controlPixe
lData.begin(), 0)); |
111 // 16-bit floating point textures are NOT supported everywhere | 111 // 16-bit floating point textures are NOT supported everywhere |
112 if (NULL == fpTexture) { | 112 if (NULL == fpTexture) { |
113 continue; | 113 continue; |
114 } | 114 } |
115 fpTexture->readPixels(0, 0, DEV_W, DEV_H, desc.fConfig, readBuffer.b
egin(), 0); | 115 fpTexture->readPixels(0, 0, DEV_W, DEV_H, desc.fConfig, readBuffer.b
egin(), 0); |
116 REPORTER_ASSERT(reporter, | 116 REPORTER_ASSERT(reporter, |
117 0 == memcmp(readBuffer.begin(), controlPixelData.begin(), re
adBuffer.bytes())); | 117 0 == memcmp(readBuffer.begin(), controlPixelData.begin(), re
adBuffer.bytes())); |
118 } | 118 } |
119 } | 119 } |
120 } | 120 } |
121 | 121 |
122 #endif | 122 #endif |
OLD | NEW |