| 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 "GrBlurUtils.h" | 10 #include "GrBlurUtils.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 at = kPremul_SkAlphaType; // force this setting | 222 at = kPremul_SkAlphaType; // force this setting |
| 223 } | 223 } |
| 224 const SkImageInfo info = SkImageInfo::Make(origInfo.width(), origInfo.height
(), ct, at); | 224 const SkImageInfo info = SkImageInfo::Make(origInfo.width(), origInfo.height
(), ct, at); |
| 225 | 225 |
| 226 GrSurfaceDesc desc; | 226 GrSurfaceDesc desc; |
| 227 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 227 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
| 228 desc.fWidth = info.width(); | 228 desc.fWidth = info.width(); |
| 229 desc.fHeight = info.height(); | 229 desc.fHeight = info.height(); |
| 230 desc.fConfig = SkImageInfo2GrPixelConfig(info); | 230 desc.fConfig = SkImageInfo2GrPixelConfig(info); |
| 231 desc.fSampleCnt = sampleCount; | 231 desc.fSampleCnt = sampleCount; |
| 232 desc.fIsMipMapped = false; |
| 232 GrTexture* texture = context->textureProvider()->createTexture( | 233 GrTexture* texture = context->textureProvider()->createTexture( |
| 233 desc, SkToBool(budgeted), nullptr, 0); | 234 desc, SkToBool(budgeted), nullptr, 0); |
| 234 if (nullptr == texture) { | 235 if (nullptr == texture) { |
| 235 return nullptr; | 236 return nullptr; |
| 236 } | 237 } |
| 237 SkASSERT(nullptr != texture->asRenderTarget()); | 238 SkASSERT(nullptr != texture->asRenderTarget()); |
| 238 return texture->asRenderTarget(); | 239 return texture->asRenderTarget(); |
| 239 } | 240 } |
| 240 | 241 |
| 241 SkGpuDevice::~SkGpuDevice() { | 242 SkGpuDevice::~SkGpuDevice() { |
| (...skipping 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1972 #endif | 1973 #endif |
| 1973 } | 1974 } |
| 1974 | 1975 |
| 1975 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1976 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 1976 // We always return a transient cache, so it is freed after each | 1977 // We always return a transient cache, so it is freed after each |
| 1977 // filter traversal. | 1978 // filter traversal. |
| 1978 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1979 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
| 1979 } | 1980 } |
| 1980 | 1981 |
| 1981 #endif | 1982 #endif |
| OLD | NEW |