Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: src/gpu/SkGpuDevice.cpp

Issue 2357273002: Add output format properties to SkImageFilter::Context (Closed)
Patch Set: Spelling Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | src/image/SkImage.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | src/image/SkImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698