OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 #include <initializer_list> | 8 #include <initializer_list> |
9 #include "Test.h" | 9 #include "Test.h" |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 uint8_t expectedComponent = SkScalarRoundToInt((lower + upper) * 127
.5f); | 61 uint8_t expectedComponent = SkScalarRoundToInt((lower + upper) * 127
.5f); |
62 expectedColor |= expectedComponent << (c * 8); | 62 expectedColor |= expectedComponent << (c * 8); |
63 } | 63 } |
64 | 64 |
65 *expected = expectedColor; | 65 *expected = expectedColor; |
66 return result; | 66 return result; |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ApplyGamma, reporter, ctxInfo) { | 70 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ApplyGamma, reporter, ctxInfo) { |
71 GrContext* context = ctxInfo.fGrContext; | 71 GrContext* context = ctxInfo.grContext(); |
72 static const int kW = 10; | 72 static const int kW = 10; |
73 static const int kH = 10; | 73 static const int kH = 10; |
74 static const size_t kRowBytes = sizeof(uint32_t) * kW; | 74 static const size_t kRowBytes = sizeof(uint32_t) * kW; |
75 | 75 |
76 GrSurfaceDesc baseDesc; | 76 GrSurfaceDesc baseDesc; |
77 baseDesc.fConfig = kRGBA_8888_GrPixelConfig; | 77 baseDesc.fConfig = kRGBA_8888_GrPixelConfig; |
78 baseDesc.fWidth = kW; | 78 baseDesc.fWidth = kW; |
79 baseDesc.fHeight = kH; | 79 baseDesc.fHeight = kH; |
80 | 80 |
81 SkAutoTMalloc<uint32_t> srcPixels(kW * kH); | 81 SkAutoTMalloc<uint32_t> srcPixels(kW * kH); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 break; | 147 break; |
148 } | 148 } |
149 } | 149 } |
150 } | 150 } |
151 } | 151 } |
152 } | 152 } |
153 } | 153 } |
154 } | 154 } |
155 } | 155 } |
156 #endif | 156 #endif |
OLD | NEW |