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; | |
46 desc.fWidth = DEV_W; | 45 desc.fWidth = DEV_W; |
47 desc.fHeight = DEV_H; | 46 desc.fHeight = DEV_H; |
48 desc.fConfig = config; | 47 desc.fConfig = config; |
49 desc.fOrigin = 0 == origin ? | 48 desc.fOrigin = 0 == origin ? |
50 kTopLeft_GrSurfaceOrigin : kBottomLeft_GrSurfaceOrigin; | 49 kTopLeft_GrSurfaceOrigin : kBottomLeft_GrSurfaceOrigin; |
51 | 50 |
52 GrContextFactory::GLContextType type = | 51 GrContextFactory::GLContextType type = |
53 static_cast<GrContextFactory::GLContextType>(glCtxType); | 52 static_cast<GrContextFactory::GLContextType>(glCtxType); |
54 if (!GrContextFactory::IsRenderingGLContext(type)) { | 53 if (!GrContextFactory::IsRenderingGLContext(type)) { |
55 continue; | 54 continue; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 91 |
93 static const int HALF_RGBA_CONTROL_ARRAY_SIZE = DEV_W * DEV_H * 4 /*RGBA*/; | 92 static const int HALF_RGBA_CONTROL_ARRAY_SIZE = DEV_W * DEV_H * 4 /*RGBA*/; |
94 | 93 |
95 DEF_GPUTEST(HalfFloatRGBATextureTest, reporter, factory) { | 94 DEF_GPUTEST(HalfFloatRGBATextureTest, reporter, factory) { |
96 runFPTest<SkHalf>(reporter, factory, SK_HalfMin, SK_HalfMax, SK_HalfEpsilon, | 95 runFPTest<SkHalf>(reporter, factory, SK_HalfMin, SK_HalfMax, SK_HalfEpsilon, |
97 kMaxIntegerRepresentableInHalfFloatingPoint, | 96 kMaxIntegerRepresentableInHalfFloatingPoint, |
98 HALF_RGBA_CONTROL_ARRAY_SIZE, kRGBA_half_GrPixelConfig); | 97 HALF_RGBA_CONTROL_ARRAY_SIZE, kRGBA_half_GrPixelConfig); |
99 } | 98 } |
100 | 99 |
101 #endif | 100 #endif |
OLD | NEW |