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 24 matching lines...) Expand all Loading... |
35 for (int i = 0; i < arraySize; i += 4) { | 35 for (int i = 0; i < arraySize; i += 4) { |
36 controlPixelData[i + 0] = min; | 36 controlPixelData[i + 0] = min; |
37 controlPixelData[i + 1] = max; | 37 controlPixelData[i + 1] = max; |
38 controlPixelData[i + 2] = epsilon; | 38 controlPixelData[i + 2] = epsilon; |
39 controlPixelData[i + 3] = maxInt; | 39 controlPixelData[i + 3] = maxInt; |
40 } | 40 } |
41 | 41 |
42 for (int origin = 0; origin < 2; ++origin) { | 42 for (int origin = 0; origin < 2; ++origin) { |
43 for (int glCtxType = 0; glCtxType < GrContextFactory::kGLContextTypeCnt;
++glCtxType) { | 43 for (int glCtxType = 0; glCtxType < GrContextFactory::kGLContextTypeCnt;
++glCtxType) { |
44 GrSurfaceDesc desc; | 44 GrSurfaceDesc desc; |
| 45 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
45 desc.fWidth = DEV_W; | 46 desc.fWidth = DEV_W; |
46 desc.fHeight = DEV_H; | 47 desc.fHeight = DEV_H; |
47 desc.fConfig = config; | 48 desc.fConfig = config; |
48 desc.fOrigin = 0 == origin ? | 49 desc.fOrigin = 0 == origin ? |
49 kTopLeft_GrSurfaceOrigin : kBottomLeft_GrSurfaceOrigin; | 50 kTopLeft_GrSurfaceOrigin : kBottomLeft_GrSurfaceOrigin; |
50 | 51 |
51 GrContextFactory::GLContextType type = | 52 GrContextFactory::GLContextType type = |
52 static_cast<GrContextFactory::GLContextType>(glCtxType); | 53 static_cast<GrContextFactory::GLContextType>(glCtxType); |
53 if (!GrContextFactory::IsRenderingGLContext(type)) { | 54 if (!GrContextFactory::IsRenderingGLContext(type)) { |
54 continue; | 55 continue; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 92 |
92 static const int HALF_RGBA_CONTROL_ARRAY_SIZE = DEV_W * DEV_H * 4 /*RGBA*/; | 93 static const int HALF_RGBA_CONTROL_ARRAY_SIZE = DEV_W * DEV_H * 4 /*RGBA*/; |
93 | 94 |
94 DEF_GPUTEST(HalfFloatRGBATextureTest, reporter, factory) { | 95 DEF_GPUTEST(HalfFloatRGBATextureTest, reporter, factory) { |
95 runFPTest<SkHalf>(reporter, factory, SK_HalfMin, SK_HalfMax, SK_HalfEpsilon, | 96 runFPTest<SkHalf>(reporter, factory, SK_HalfMin, SK_HalfMax, SK_HalfEpsilon, |
96 kMaxIntegerRepresentableInHalfFloatingPoint, | 97 kMaxIntegerRepresentableInHalfFloatingPoint, |
97 HALF_RGBA_CONTROL_ARRAY_SIZE, kRGBA_half_GrPixelConfig); | 98 HALF_RGBA_CONTROL_ARRAY_SIZE, kRGBA_half_GrPixelConfig); |
98 } | 99 } |
99 | 100 |
100 #endif | 101 #endif |
OLD | NEW |