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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 at = kPremul_SkAlphaType; // force this setting | 224 at = kPremul_SkAlphaType; // force this setting |
225 } | 225 } |
226 const SkImageInfo info = SkImageInfo::Make(origInfo.width(), origInfo.height
(), ct, at); | 226 const SkImageInfo info = SkImageInfo::Make(origInfo.width(), origInfo.height
(), ct, at); |
227 | 227 |
228 GrSurfaceDesc desc; | 228 GrSurfaceDesc desc; |
229 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 229 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
230 desc.fWidth = info.width(); | 230 desc.fWidth = info.width(); |
231 desc.fHeight = info.height(); | 231 desc.fHeight = info.height(); |
232 desc.fConfig = SkImageInfo2GrPixelConfig(info); | 232 desc.fConfig = SkImageInfo2GrPixelConfig(info); |
233 desc.fSampleCnt = sampleCount; | 233 desc.fSampleCnt = sampleCount; |
| 234 desc.fIsMipMapped = false; |
234 GrTexture* texture = context->textureProvider()->createTexture( | 235 GrTexture* texture = context->textureProvider()->createTexture( |
235 desc, SkToBool(budgeted), nullptr, 0); | 236 desc, SkToBool(budgeted), nullptr, 0); |
236 if (nullptr == texture) { | 237 if (nullptr == texture) { |
237 return nullptr; | 238 return nullptr; |
238 } | 239 } |
239 SkASSERT(nullptr != texture->asRenderTarget()); | 240 SkASSERT(nullptr != texture->asRenderTarget()); |
240 return texture->asRenderTarget(); | 241 return texture->asRenderTarget(); |
241 } | 242 } |
242 | 243 |
243 SkGpuDevice::~SkGpuDevice() { | 244 SkGpuDevice::~SkGpuDevice() { |
(...skipping 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2019 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 2020 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
2020 } | 2021 } |
2021 | 2022 |
2022 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 2023 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
2023 // We always return a transient cache, so it is freed after each | 2024 // We always return a transient cache, so it is freed after each |
2024 // filter traversal. | 2025 // filter traversal. |
2025 return SkGpuDevice::NewImageFilterCache(); | 2026 return SkGpuDevice::NewImageFilterCache(); |
2026 } | 2027 } |
2027 | 2028 |
2028 #endif | 2029 #endif |
OLD | NEW |