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 "GrInvariantOutput.h" | 10 #include "GrInvariantOutput.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 GrSurfaceDesc desc; | 181 GrSurfaceDesc desc; |
182 desc.fFlags = kRenderTarget_GrSurfaceFlag | | 182 desc.fFlags = kRenderTarget_GrSurfaceFlag | |
183 kNoStencil_GrSurfaceFlag; | 183 kNoStencil_GrSurfaceFlag; |
184 desc.fWidth = 256; | 184 desc.fWidth = 256; |
185 desc.fHeight = 256; | 185 desc.fHeight = 256; |
186 desc.fConfig = kRGBA_8888_GrPixelConfig; | 186 desc.fConfig = kRGBA_8888_GrPixelConfig; |
187 | 187 |
188 SkAutoTUnref<GrTexture> readTex(context->createUncachedTexture(desc, NULL, 0
)); | 188 SkAutoTUnref<GrTexture> readTex(context->createTexture(desc, true, NULL, 0))
; |
189 if (!readTex.get()) { | 189 if (!readTex.get()) { |
190 return; | 190 return; |
191 } | 191 } |
192 SkAutoTUnref<GrTexture> tempTex(context->createUncachedTexture(desc, NULL, 0
)); | 192 SkAutoTUnref<GrTexture> tempTex(context->createTexture(desc, true, NULL, 0))
; |
193 if (!tempTex.get()) { | 193 if (!tempTex.get()) { |
194 return; | 194 return; |
195 } | 195 } |
196 desc.fFlags = kNone_GrSurfaceFlags; | 196 desc.fFlags = kNone_GrSurfaceFlags; |
197 SkAutoTUnref<GrTexture> dataTex(context->createUncachedTexture(desc, data, 0
)); | 197 SkAutoTUnref<GrTexture> dataTex(context->createTexture(desc, true, data, 0))
; |
198 if (!dataTex.get()) { | 198 if (!dataTex.get()) { |
199 return; | 199 return; |
200 } | 200 } |
201 | 201 |
202 static const PMConversion kConversionRules[][2] = { | 202 static const PMConversion kConversionRules[][2] = { |
203 {kDivByAlpha_RoundDown_PMConversion, kMulByAlpha_RoundUp_PMConversion}, | 203 {kDivByAlpha_RoundDown_PMConversion, kMulByAlpha_RoundUp_PMConversion}, |
204 {kDivByAlpha_RoundUp_PMConversion, kMulByAlpha_RoundDown_PMConversion}, | 204 {kDivByAlpha_RoundUp_PMConversion, kMulByAlpha_RoundDown_PMConversion}, |
205 }; | 205 }; |
206 | 206 |
207 GrContext::AutoWideOpenIdentityDraw awoid(context, NULL); | 207 GrContext::AutoWideOpenIdentityDraw awoid(context, NULL); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 kNone_PMConversion != pmConversion) { | 278 kNone_PMConversion != pmConversion) { |
279 // The PM conversions assume colors are 0..255 | 279 // The PM conversions assume colors are 0..255 |
280 return NULL; | 280 return NULL; |
281 } | 281 } |
282 return SkNEW_ARGS(GrConfigConversionEffect, (texture, | 282 return SkNEW_ARGS(GrConfigConversionEffect, (texture, |
283 swapRedAndBlue, | 283 swapRedAndBlue, |
284 pmConversion, | 284 pmConversion, |
285 matrix)); | 285 matrix)); |
286 } | 286 } |
287 } | 287 } |
OLD | NEW |