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(de
sc, true, nullptr, 0)); | 180 SkAutoTUnref<GrTexture> readTex(context->textureProvider()->createTexture(de
sc, true, nullptr, 0)); |
180 if (!readTex.get()) { | 181 if (!readTex.get()) { |
181 return; | 182 return; |
182 } | 183 } |
183 SkAutoTUnref<GrTexture> tempTex(context->textureProvider()->createTexture(de
sc, true, nullptr, 0)); | 184 SkAutoTUnref<GrTexture> tempTex(context->textureProvider()->createTexture(de
sc, true, nullptr, 0)); |
184 if (!tempTex.get()) { | 185 if (!tempTex.get()) { |
185 return; | 186 return; |
186 } | 187 } |
187 desc.fFlags = kNone_GrSurfaceFlags; | 188 desc.fFlags = kNone_GrSurfaceFlags; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 } else { | 297 } else { |
297 if (kRGBA_8888_GrPixelConfig != texture->config() && | 298 if (kRGBA_8888_GrPixelConfig != texture->config() && |
298 kBGRA_8888_GrPixelConfig != texture->config() && | 299 kBGRA_8888_GrPixelConfig != texture->config() && |
299 kNone_PMConversion != pmConversion) { | 300 kNone_PMConversion != pmConversion) { |
300 // The PM conversions assume colors are 0..255 | 301 // The PM conversions assume colors are 0..255 |
301 return nullptr; | 302 return nullptr; |
302 } | 303 } |
303 return new GrConfigConversionEffect(texture, swizzle, pmConversion, matr
ix); | 304 return new GrConfigConversionEffect(texture, swizzle, pmConversion, matr
ix); |
304 } | 305 } |
305 } | 306 } |
OLD | NEW |