| 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 "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 orig, read, subtestName, i, j); | 133 orig, read, subtestName, i, j); |
| 134 return; | 134 return; |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 | 139 |
| 140 // TODO: Add tests for copySurface between srgb/linear textures. Add tests for u
npremul/premul | 140 // TODO: Add tests for copySurface between srgb/linear textures. Add tests for u
npremul/premul |
| 141 // conversion during read/write along with srgb/linear conversions. | 141 // conversion during read/write along with srgb/linear conversions. |
| 142 DEF_GPUTEST(SRGBReadWritePixels, reporter, factory) { | 142 DEF_GPUTEST(SRGBReadWritePixels, reporter, factory) { |
| 143 #if defined(GOOGLE3) |
| 144 // Stack frame size is limited in GOOGLE3. |
| 145 static const int kW = 63; |
| 146 static const int kH = 63; |
| 147 #else |
| 143 static const int kW = 255; | 148 static const int kW = 255; |
| 144 static const int kH = 255; | 149 static const int kH = 255; |
| 150 #endif |
| 145 uint32_t origData[kW * kH]; | 151 uint32_t origData[kW * kH]; |
| 146 for (int j = 0; j < kH; ++j) { | 152 for (int j = 0; j < kH; ++j) { |
| 147 for (int i = 0; i < kW; ++i) { | 153 for (int i = 0; i < kW; ++i) { |
| 148 origData[j * kW + i] = (j << 24) | (i << 16) | (i << 8) | i; | 154 origData[j * kW + i] = (j << 24) | (i << 16) | (i << 8) | i; |
| 149 } | 155 } |
| 150 } | 156 } |
| 151 | 157 |
| 152 for (int t = 0; t < GrContextFactory::kGLContextTypeCnt; ++t) { | 158 for (int t = 0; t < GrContextFactory::kGLContextTypeCnt; ++t) { |
| 153 GrContextFactory::GLContextType glType = (GrContextFactory::GLContextTyp
e) t; | 159 GrContextFactory::GLContextType glType = (GrContextFactory::GLContextTyp
e) t; |
| 154 GrContext* context; | 160 GrContext* context; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 read_and_check_pixels(reporter, tex, origData, kSRGBA_8888_GrPix
elConfig, | 232 read_and_check_pixels(reporter, tex, origData, kSRGBA_8888_GrPix
elConfig, |
| 227 check_linear_to_srgb_conversion, 1.2f, | 233 check_linear_to_srgb_conversion, 1.2f, |
| 228 "write rgba/read srgba to rgba texture"); | 234 "write rgba/read srgba to rgba texture"); |
| 229 } else { | 235 } else { |
| 230 ERRORF(reporter, "Could not write rgba data to rgba texture."); | 236 ERRORF(reporter, "Could not write rgba data to rgba texture."); |
| 231 } | 237 } |
| 232 } | 238 } |
| 233 } | 239 } |
| 234 } | 240 } |
| 235 #endif | 241 #endif |
| OLD | NEW |