| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkGpuDevice.h" | 8 #include "SkGpuDevice.h" |
| 9 | 9 |
| 10 #include "effects/GrBicubicEffect.h" | 10 #include "effects/GrBicubicEffect.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 origInfo.width() < 0 || origInfo.height() < 0) { | 222 origInfo.width() < 0 || origInfo.height() < 0) { |
| 223 return NULL; | 223 return NULL; |
| 224 } | 224 } |
| 225 | 225 |
| 226 SkImageInfo info = origInfo; | 226 SkImageInfo info = origInfo; |
| 227 // TODO: perhas we can loosen this check now that colortype is more detailed | 227 // TODO: perhas we can loosen this check now that colortype is more detailed |
| 228 // e.g. can we support both RGBA and BGRA here? | 228 // e.g. can we support both RGBA and BGRA here? |
| 229 if (kRGB_565_SkColorType == info.colorType()) { | 229 if (kRGB_565_SkColorType == info.colorType()) { |
| 230 info.fAlphaType = kOpaque_SkAlphaType; // force this setting | 230 info.fAlphaType = kOpaque_SkAlphaType; // force this setting |
| 231 } else { | 231 } else { |
| 232 info.fColorType = kPMColor_SkColorType; | 232 info.fColorType = kN32_SkColorType; |
| 233 if (kOpaque_SkAlphaType != info.alphaType()) { | 233 if (kOpaque_SkAlphaType != info.alphaType()) { |
| 234 info.fAlphaType = kPremul_SkAlphaType; // force this setting | 234 info.fAlphaType = kPremul_SkAlphaType; // force this setting |
| 235 } | 235 } |
| 236 } | 236 } |
| 237 | 237 |
| 238 GrTextureDesc desc; | 238 GrTextureDesc desc; |
| 239 desc.fFlags = kRenderTarget_GrTextureFlagBit; | 239 desc.fFlags = kRenderTarget_GrTextureFlagBit; |
| 240 desc.fWidth = info.width(); | 240 desc.fWidth = info.width(); |
| 241 desc.fHeight = info.height(); | 241 desc.fHeight = info.height(); |
| 242 desc.fConfig = SkImageInfo2GrPixelConfig(info.colorType(), info.alphaType())
; | 242 desc.fConfig = SkImageInfo2GrPixelConfig(info.colorType(), info.alphaType())
; |
| (...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1995 const GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrC
reate(picture, i); | 1995 const GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrC
reate(picture, i); |
| 1996 | 1996 |
| 1997 SkDebugf("%d (%d), ", i, layer->layerID()); | 1997 SkDebugf("%d (%d), ", i, layer->layerID()); |
| 1998 } | 1998 } |
| 1999 } | 1999 } |
| 2000 SkDebugf("\n"); | 2000 SkDebugf("\n"); |
| 2001 #endif | 2001 #endif |
| 2002 | 2002 |
| 2003 return false; | 2003 return false; |
| 2004 } | 2004 } |
| OLD | NEW |