| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 } | 209 } |
| 210 const SkImageInfo info = SkImageInfo::Make(origInfo.width(), origInfo.height
(), ct, at); | 210 const SkImageInfo info = SkImageInfo::Make(origInfo.width(), origInfo.height
(), ct, at); |
| 211 | 211 |
| 212 GrSurfaceDesc desc; | 212 GrSurfaceDesc desc; |
| 213 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 213 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
| 214 desc.fWidth = info.width(); | 214 desc.fWidth = info.width(); |
| 215 desc.fHeight = info.height(); | 215 desc.fHeight = info.height(); |
| 216 desc.fConfig = SkImageInfo2GrPixelConfig(info); | 216 desc.fConfig = SkImageInfo2GrPixelConfig(info); |
| 217 desc.fSampleCnt = sampleCount; | 217 desc.fSampleCnt = sampleCount; |
| 218 desc.fTextureStorageAllocator = textureStorageAllocator; | 218 desc.fTextureStorageAllocator = textureStorageAllocator; |
| 219 desc.fIsMipMapped = false; |
| 219 GrTexture* texture = context->textureProvider()->createTexture( | 220 GrTexture* texture = context->textureProvider()->createTexture( |
| 220 desc, SkToBool(budgeted), nullptr, 0); | 221 desc, SkToBool(budgeted), nullptr, 0); |
| 221 if (nullptr == texture) { | 222 if (nullptr == texture) { |
| 222 return nullptr; | 223 return nullptr; |
| 223 } | 224 } |
| 224 SkASSERT(nullptr != texture->asRenderTarget()); | 225 SkASSERT(nullptr != texture->asRenderTarget()); |
| 225 return texture->asRenderTarget(); | 226 return texture->asRenderTarget(); |
| 226 } | 227 } |
| 227 | 228 |
| 228 /////////////////////////////////////////////////////////////////////////////// | 229 /////////////////////////////////////////////////////////////////////////////// |
| (...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1883 } | 1884 } |
| 1884 | 1885 |
| 1885 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1886 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 1886 ASSERT_SINGLE_OWNER | 1887 ASSERT_SINGLE_OWNER |
| 1887 // We always return a transient cache, so it is freed after each | 1888 // We always return a transient cache, so it is freed after each |
| 1888 // filter traversal. | 1889 // filter traversal. |
| 1889 return SkGpuDevice::NewImageFilterCache(); | 1890 return SkGpuDevice::NewImageFilterCache(); |
| 1890 } | 1891 } |
| 1891 | 1892 |
| 1892 #endif | 1893 #endif |
| OLD | NEW |