OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "Test.h" | 8 #include "Test.h" |
9 #if SK_SUPPORT_GPU | 9 #if SK_SUPPORT_GPU |
10 #include "GrCaps.h" | 10 #include "GrCaps.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 ERRORF(reporter, "Expected 0x%08x, read back as 0x%08x in %s at
%d, %d).", | 131 ERRORF(reporter, "Expected 0x%08x, read back as 0x%08x in %s at
%d, %d).", |
132 orig, read, subtestName, i, j); | 132 orig, read, subtestName, i, j); |
133 return; | 133 return; |
134 } | 134 } |
135 } | 135 } |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
139 // TODO: Add tests for copySurface between srgb/linear textures. Add tests for u
npremul/premul | 139 // TODO: Add tests for copySurface between srgb/linear textures. Add tests for u
npremul/premul |
140 // conversion during read/write along with srgb/linear conversions. | 140 // conversion during read/write along with srgb/linear conversions. |
141 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SRGBReadWritePixels, reporter, context) { | 141 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SRGBReadWritePixels, reporter, ctxInfo) { |
| 142 GrContext* context = ctxInfo.fGrContext; |
142 #if defined(GOOGLE3) | 143 #if defined(GOOGLE3) |
143 // Stack frame size is limited in GOOGLE3. | 144 // Stack frame size is limited in GOOGLE3. |
144 static const int kW = 63; | 145 static const int kW = 63; |
145 static const int kH = 63; | 146 static const int kH = 63; |
146 #else | 147 #else |
147 static const int kW = 255; | 148 static const int kW = 255; |
148 static const int kH = 255; | 149 static const int kH = 255; |
149 #endif | 150 #endif |
150 uint32_t origData[kW * kH]; | 151 uint32_t origData[kW * kH]; |
151 for (int j = 0; j < kH; ++j) { | 152 for (int j = 0; j < kH; ++j) { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 if (tex->writePixels(0, 0, kW, kH, kRGBA_8888_GrPixelConfig, origData))
{ | 224 if (tex->writePixels(0, 0, kW, kH, kRGBA_8888_GrPixelConfig, origData))
{ |
224 read_and_check_pixels(reporter, tex, origData, kSRGBA_8888_GrPixelCo
nfig, | 225 read_and_check_pixels(reporter, tex, origData, kSRGBA_8888_GrPixelCo
nfig, |
225 check_linear_to_srgb_conversion, 1.2f, | 226 check_linear_to_srgb_conversion, 1.2f, |
226 "write rgba/read srgba to rgba texture"); | 227 "write rgba/read srgba to rgba texture"); |
227 } else { | 228 } else { |
228 ERRORF(reporter, "Could not write rgba data to rgba texture."); | 229 ERRORF(reporter, "Could not write rgba data to rgba texture."); |
229 } | 230 } |
230 } | 231 } |
231 } | 232 } |
232 #endif | 233 #endif |
OLD | NEW |