| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 color[1] = SkTMin(x, y); | 172 color[1] = SkTMin(x, y); |
| 173 color[0] = SkTMin(x, y); | 173 color[0] = SkTMin(x, y); |
| 174 } | 174 } |
| 175 } | 175 } |
| 176 | 176 |
| 177 GrSurfaceDesc desc; | 177 GrSurfaceDesc desc; |
| 178 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 178 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
| 179 desc.fWidth = 256; | 179 desc.fWidth = 256; |
| 180 desc.fHeight = 256; | 180 desc.fHeight = 256; |
| 181 desc.fConfig = kRGBA_8888_GrPixelConfig; | 181 desc.fConfig = kRGBA_8888_GrPixelConfig; |
| 182 desc.fIsMipMapped = false; |
| 182 | 183 |
| 183 SkAutoTUnref<GrTexture> readTex(context->textureProvider()->createTexture(de
sc, true, nullptr, 0)); | 184 SkAutoTUnref<GrTexture> readTex(context->textureProvider()->createTexture(de
sc, true, nullptr, 0)); |
| 184 if (!readTex.get()) { | 185 if (!readTex.get()) { |
| 185 return; | 186 return; |
| 186 } | 187 } |
| 187 SkAutoTUnref<GrTexture> tempTex(context->textureProvider()->createTexture(de
sc, true, nullptr, 0)); | 188 SkAutoTUnref<GrTexture> tempTex(context->textureProvider()->createTexture(de
sc, true, nullptr, 0)); |
| 188 if (!tempTex.get()) { | 189 if (!tempTex.get()) { |
| 189 return; | 190 return; |
| 190 } | 191 } |
| 191 desc.fFlags = kNone_GrSurfaceFlags; | 192 desc.fFlags = kNone_GrSurfaceFlags; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 } else { | 298 } else { |
| 298 if (kRGBA_8888_GrPixelConfig != texture->config() && | 299 if (kRGBA_8888_GrPixelConfig != texture->config() && |
| 299 kBGRA_8888_GrPixelConfig != texture->config() && | 300 kBGRA_8888_GrPixelConfig != texture->config() && |
| 300 kNone_PMConversion != pmConversion) { | 301 kNone_PMConversion != pmConversion) { |
| 301 // The PM conversions assume colors are 0..255 | 302 // The PM conversions assume colors are 0..255 |
| 302 return nullptr; | 303 return nullptr; |
| 303 } | 304 } |
| 304 return new GrConfigConversionEffect(texture, swapRedAndBlue, pmConversio
n, matrix); | 305 return new GrConfigConversionEffect(texture, swapRedAndBlue, pmConversio
n, matrix); |
| 305 } | 306 } |
| 306 } | 307 } |
| OLD | NEW |