| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 int left, int top, | 182 int left, int top, |
| 183 SkIPoint* offset, | 183 SkIPoint* offset, |
| 184 const SkImageFilter* filter) { | 184 const SkImageFilter* filter) { |
| 185 SkASSERT(srcImg->isTextureBacked()); | 185 SkASSERT(srcImg->isTextureBacked()); |
| 186 SkASSERT(filter); | 186 SkASSERT(filter); |
| 187 | 187 |
| 188 SkMatrix matrix = *draw.fMatrix; | 188 SkMatrix matrix = *draw.fMatrix; |
| 189 matrix.postTranslate(SkIntToScalar(-left), SkIntToScalar(-top)); | 189 matrix.postTranslate(SkIntToScalar(-left), SkIntToScalar(-top)); |
| 190 const SkIRect clipBounds = draw.fRC->getBounds().makeOffset(-left, -top); | 190 const SkIRect clipBounds = draw.fRC->getBounds().makeOffset(-left, -top); |
| 191 SkAutoTUnref<SkImageFilterCache> cache(this->getImageFilterCache()); | 191 SkAutoTUnref<SkImageFilterCache> cache(this->getImageFilterCache()); |
| 192 SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); | 192 SkImageFilter::OutputProperties outputProperties(fDrawContext->getColorSpace
()); |
| 193 SkImageFilter::Context ctx(matrix, clipBounds, cache.get(), outputProperties
); |
| 193 | 194 |
| 194 return filter->filterImage(srcImg, ctx, offset); | 195 return filter->filterImage(srcImg, ctx, offset); |
| 195 } | 196 } |
| 196 | 197 |
| 197 /////////////////////////////////////////////////////////////////////////////// | 198 /////////////////////////////////////////////////////////////////////////////// |
| 198 | 199 |
| 199 bool SkGpuDevice::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size
_t dstRowBytes, | 200 bool SkGpuDevice::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size
_t dstRowBytes, |
| 200 int x, int y) { | 201 int x, int y) { |
| 201 ASSERT_SINGLE_OWNER | 202 ASSERT_SINGLE_OWNER |
| 202 | 203 |
| (...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1813 } | 1814 } |
| 1814 | 1815 |
| 1815 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { | 1816 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { |
| 1816 ASSERT_SINGLE_OWNER | 1817 ASSERT_SINGLE_OWNER |
| 1817 // We always return a transient cache, so it is freed after each | 1818 // We always return a transient cache, so it is freed after each |
| 1818 // filter traversal. | 1819 // filter traversal. |
| 1819 return SkImageFilterCache::Create(SkImageFilterCache::kDefaultTransientSize)
; | 1820 return SkImageFilterCache::Create(SkImageFilterCache::kDefaultTransientSize)
; |
| 1820 } | 1821 } |
| 1821 | 1822 |
| 1822 #endif | 1823 #endif |
| OLD | NEW |