OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrConfigConversionEffect.h" | 8 #include "GrConfigConversionEffect.h" |
9 #include "GrContext.h" | 9 #include "GrContext.h" |
10 #include "GrDrawContext.h" | 10 #include "GrDrawContext.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 color[1] = SkTMin(x, y); | 168 color[1] = SkTMin(x, y); |
169 color[0] = SkTMin(x, y); | 169 color[0] = SkTMin(x, y); |
170 } | 170 } |
171 } | 171 } |
172 | 172 |
173 GrSurfaceDesc desc; | 173 GrSurfaceDesc desc; |
174 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 174 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
175 desc.fWidth = 256; | 175 desc.fWidth = 256; |
176 desc.fHeight = 256; | 176 desc.fHeight = 256; |
177 desc.fConfig = kRGBA_8888_GrPixelConfig; | 177 desc.fConfig = kRGBA_8888_GrPixelConfig; |
| 178 desc.fIsMipMapped = false; |
178 | 179 |
179 SkAutoTUnref<GrTexture> readTex(context->textureProvider()->createTexture( | 180 SkAutoTUnref<GrTexture> readTex(context->textureProvider()->createTexture( |
180 desc, SkBudgeted::kYes, nullptr, 0)); | 181 desc, SkBudgeted::kYes, nullptr, 0)); |
181 if (!readTex.get()) { | 182 if (!readTex.get()) { |
182 return; | 183 return; |
183 } | 184 } |
184 SkAutoTUnref<GrTexture> tempTex(context->textureProvider()->createTexture( | 185 SkAutoTUnref<GrTexture> tempTex(context->textureProvider()->createTexture( |
185 desc, SkBudgeted::kYes, nullptr, 0)); | 186 desc, SkBudgeted::kYes, nullptr, 0)); |
186 if (!tempTex.get()) { | 187 if (!tempTex.get()) { |
187 return; | 188 return; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 } else { | 300 } else { |
300 if (kRGBA_8888_GrPixelConfig != texture->config() && | 301 if (kRGBA_8888_GrPixelConfig != texture->config() && |
301 kBGRA_8888_GrPixelConfig != texture->config() && | 302 kBGRA_8888_GrPixelConfig != texture->config() && |
302 kNone_PMConversion != pmConversion) { | 303 kNone_PMConversion != pmConversion) { |
303 // The PM conversions assume colors are 0..255 | 304 // The PM conversions assume colors are 0..255 |
304 return nullptr; | 305 return nullptr; |
305 } | 306 } |
306 return new GrConfigConversionEffect(texture, swizzle, pmConversion, matr
ix); | 307 return new GrConfigConversionEffect(texture, swizzle, pmConversion, matr
ix); |
307 } | 308 } |
308 } | 309 } |
OLD | NEW |