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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(FloatingPointTextureTest, reporter, ctxInfo)
{ | 63 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(FloatingPointTextureTest, reporter, ctxInfo)
{ |
64 runFPTest<float>(reporter, ctxInfo.grContext(), FLT_MIN, FLT_MAX, FLT_EPSILO
N, | 64 runFPTest<float>(reporter, ctxInfo.grContext(), FLT_MIN, FLT_MAX, FLT_EPSILO
N, |
65 kMaxIntegerRepresentableInSPFloatingPoint, | 65 kMaxIntegerRepresentableInSPFloatingPoint, |
66 FP_CONTROL_ARRAY_SIZE, kRGBA_float_GrPixelConfig); | 66 FP_CONTROL_ARRAY_SIZE, kRGBA_float_GrPixelConfig); |
67 } | 67 } |
68 | 68 |
69 static const int HALF_ALPHA_CONTROL_ARRAY_SIZE = DEV_W * DEV_H * 1 /*alpha-only*
/; | 69 static const int HALF_ALPHA_CONTROL_ARRAY_SIZE = DEV_W * DEV_H * 1 /*alpha-only*
/; |
70 static const SkHalf kMaxIntegerRepresentableInHalfFloatingPoint = 0x6800; // 2
^ 11 | 70 static const SkHalf kMaxIntegerRepresentableInHalfFloatingPoint = 0x6800; // 2
^ 11 |
71 | 71 |
72 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(HalfFloatAlphaTextureTest, reporter, ctxInfo)
{ | 72 // The half float tests currently fail on ES3 ANGLE. |
| 73 static bool is_rendering_and_not_angle_es3(sk_gpu_test::GrContextFactory::Contex
tType type) { |
| 74 if (type == sk_gpu_test::GrContextFactory::kANGLE_D3D11_ES3_ContextType || |
| 75 type == sk_gpu_test::GrContextFactory::kANGLE_GL_ES3_ContextType) { |
| 76 return false; |
| 77 } |
| 78 return sk_gpu_test::GrContextFactory::IsRenderingContext(type); |
| 79 } |
| 80 |
| 81 DEF_GPUTEST_FOR_CONTEXTS(HalfFloatAlphaTextureTest, |
| 82 &is_rendering_and_not_angle_es3, |
| 83 reporter, ctxInfo) { |
73 runFPTest<SkHalf>(reporter, ctxInfo.grContext(), SK_HalfMin, SK_HalfMax, SK_
HalfEpsilon, | 84 runFPTest<SkHalf>(reporter, ctxInfo.grContext(), SK_HalfMin, SK_HalfMax, SK_
HalfEpsilon, |
74 kMaxIntegerRepresentableInHalfFloatingPoint, | 85 kMaxIntegerRepresentableInHalfFloatingPoint, |
75 HALF_ALPHA_CONTROL_ARRAY_SIZE, kAlpha_half_GrPixelConfig); | 86 HALF_ALPHA_CONTROL_ARRAY_SIZE, kAlpha_half_GrPixelConfig); |
76 } | 87 } |
77 | 88 |
78 static const int HALF_RGBA_CONTROL_ARRAY_SIZE = DEV_W * DEV_H * 4 /*RGBA*/; | 89 static const int HALF_RGBA_CONTROL_ARRAY_SIZE = DEV_W * DEV_H * 4 /*RGBA*/; |
79 | 90 |
80 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(HalfFloatRGBATextureTest, reporter, ctxInfo)
{ | 91 DEF_GPUTEST_FOR_CONTEXTS(HalfFloatRGBATextureTest, |
| 92 &is_rendering_and_not_angle_es3, |
| 93 reporter, ctxInfo) { |
81 runFPTest<SkHalf>(reporter, ctxInfo.grContext(), SK_HalfMin, SK_HalfMax, SK_
HalfEpsilon, | 94 runFPTest<SkHalf>(reporter, ctxInfo.grContext(), SK_HalfMin, SK_HalfMax, SK_
HalfEpsilon, |
82 kMaxIntegerRepresentableInHalfFloatingPoint, | 95 kMaxIntegerRepresentableInHalfFloatingPoint, |
83 HALF_RGBA_CONTROL_ARRAY_SIZE, kRGBA_half_GrPixelConfig); | 96 HALF_RGBA_CONTROL_ARRAY_SIZE, kRGBA_half_GrPixelConfig); |
84 } | 97 } |
85 | 98 |
86 #endif | 99 #endif |
OLD | NEW |