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 = kN32_SkColorType; | 232 info.fColorType = kPMColor_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 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1973 const GrAtlasedLayer* layer = fContext->getLayerCache()->findLayerOr
Create(picture, i); | 1973 const GrAtlasedLayer* layer = fContext->getLayerCache()->findLayerOr
Create(picture, i); |
1974 | 1974 |
1975 SkDebugf("%d (%d), ", i, layer->layerID()); | 1975 SkDebugf("%d (%d), ", i, layer->layerID()); |
1976 } | 1976 } |
1977 } | 1977 } |
1978 SkDebugf("\n"); | 1978 SkDebugf("\n"); |
1979 #endif | 1979 #endif |
1980 | 1980 |
1981 return false; | 1981 return false; |
1982 } | 1982 } |
OLD | NEW |