| 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 21 matching lines...) Expand all Loading... |
| 32 controlPixelData[i] = FLT_MIN; | 32 controlPixelData[i] = FLT_MIN; |
| 33 controlPixelData[i + 1] = FLT_MAX; | 33 controlPixelData[i + 1] = FLT_MAX; |
| 34 controlPixelData[i + 2] = FLT_EPSILON; | 34 controlPixelData[i + 2] = FLT_EPSILON; |
| 35 controlPixelData[i + 3] = kMaxIntegerRepresentableInSPFloatingPoint; | 35 controlPixelData[i + 3] = kMaxIntegerRepresentableInSPFloatingPoint; |
| 36 } | 36 } |
| 37 | 37 |
| 38 for (int origin = 0; origin < 2; ++origin) { | 38 for (int origin = 0; origin < 2; ++origin) { |
| 39 int glCtxTypeCnt = 1; | 39 int glCtxTypeCnt = 1; |
| 40 glCtxTypeCnt = GrContextFactory::kGLContextTypeCnt; | 40 glCtxTypeCnt = GrContextFactory::kGLContextTypeCnt; |
| 41 for (int glCtxType = 0; glCtxType < glCtxTypeCnt; ++glCtxType) { | 41 for (int glCtxType = 0; glCtxType < glCtxTypeCnt; ++glCtxType) { |
| 42 GrTextureDesc desc; | 42 GrSurfaceDesc desc; |
| 43 desc.fFlags = kRenderTarget_GrTextureFlagBit; | 43 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
| 44 desc.fWidth = DEV_W; | 44 desc.fWidth = DEV_W; |
| 45 desc.fHeight = DEV_H; | 45 desc.fHeight = DEV_H; |
| 46 desc.fConfig = kRGBA_float_GrPixelConfig; | 46 desc.fConfig = kRGBA_float_GrPixelConfig; |
| 47 desc.fOrigin = 0 == origin ? | 47 desc.fOrigin = 0 == origin ? |
| 48 kTopLeft_GrSurfaceOrigin : kBottomLeft_GrSurfaceOrigin; | 48 kTopLeft_GrSurfaceOrigin : kBottomLeft_GrSurfaceOrigin; |
| 49 | 49 |
| 50 GrContext* context = NULL; | 50 GrContext* context = NULL; |
| 51 GrContextFactory::GLContextType type = | 51 GrContextFactory::GLContextType type = |
| 52 static_cast<GrContextFactory::GLContextType>(glCtxType); | 52 static_cast<GrContextFactory::GLContextType>(glCtxType); |
| 53 if (!GrContextFactory::IsRenderingGLContext(type)) { | 53 if (!GrContextFactory::IsRenderingGLContext(type)) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 71 fpTexture->writePixels(0, 0, DEV_W, DEV_H, desc.fConfig, controlPixe
lData, 0); | 71 fpTexture->writePixels(0, 0, DEV_W, DEV_H, desc.fConfig, controlPixe
lData, 0); |
| 72 fpTexture->readPixels(0, 0, DEV_W, DEV_H, desc.fConfig, readBuffer,
0); | 72 fpTexture->readPixels(0, 0, DEV_W, DEV_H, desc.fConfig, readBuffer,
0); |
| 73 for (int j = 0; j < FP_CONTROL_ARRAY_SIZE; ++j) { | 73 for (int j = 0; j < FP_CONTROL_ARRAY_SIZE; ++j) { |
| 74 REPORTER_ASSERT(reporter, readBuffer[j] == controlPixelData[j]); | 74 REPORTER_ASSERT(reporter, readBuffer[j] == controlPixelData[j]); |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 | 79 |
| 80 #endif | 80 #endif |
| OLD | NEW |