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_GL_RENDERING_CONTEXTS(SRGBReadWritePixels, reporter, ctxInfo) { | 141 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SRGBReadWritePixels, reporter, ctxInfo) { |
142 GrContext* context = ctxInfo.grContext(); | 142 GrContext* context = ctxInfo.grContext(); |
143 #if defined(GOOGLE3) | 143 #if defined(GOOGLE3) |
144 // Stack frame size is limited in GOOGLE3. | 144 // Stack frame size is limited in GOOGLE3. |
145 static const int kW = 63; | 145 static const int kW = 63; |
146 static const int kH = 63; | 146 static const int kH = 63; |
147 #else | 147 #else |
148 static const int kW = 255; | 148 static const int kW = 255; |
149 static const int kH = 255; | 149 static const int kH = 255; |
150 #endif | 150 #endif |
151 uint32_t origData[kW * kH]; | 151 uint32_t origData[kW * kH]; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 if (tex->writePixels(0, 0, kW, kH, kRGBA_8888_GrPixelConfig, origData))
{ | 224 if (tex->writePixels(0, 0, kW, kH, kRGBA_8888_GrPixelConfig, origData))
{ |
225 read_and_check_pixels(reporter, tex, origData, kSRGBA_8888_GrPixelCo
nfig, | 225 read_and_check_pixels(reporter, tex, origData, kSRGBA_8888_GrPixelCo
nfig, |
226 check_linear_to_srgb_conversion, 1.2f, | 226 check_linear_to_srgb_conversion, 1.2f, |
227 "write rgba/read srgba to rgba texture"); | 227 "write rgba/read srgba to rgba texture"); |
228 } else { | 228 } else { |
229 ERRORF(reporter, "Could not write rgba data to rgba texture."); | 229 ERRORF(reporter, "Could not write rgba data to rgba texture."); |
230 } | 230 } |
231 } | 231 } |
232 } | 232 } |
233 #endif | 233 #endif |
OLD | NEW |