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

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

Issue 1172693002: remove subclassing from ImageFilter::Proxy (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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
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"
11 #include "GrContext.h" 11 #include "GrContext.h"
12 #include "GrDrawContext.h" 12 #include "GrDrawContext.h"
13 #include "GrGpu.h" 13 #include "GrGpu.h"
14 #include "GrGpuResourcePriv.h" 14 #include "GrGpuResourcePriv.h"
15 #include "GrLayerHoister.h" 15 #include "GrLayerHoister.h"
16 #include "GrRecordReplaceDraw.h" 16 #include "GrRecordReplaceDraw.h"
17 #include "GrStrokeInfo.h" 17 #include "GrStrokeInfo.h"
18 #include "GrTextContext.h" 18 #include "GrTextContext.h"
19 #include "GrTracing.h" 19 #include "GrTracing.h"
20 #include "SkCanvasPriv.h" 20 #include "SkCanvasPriv.h"
21 #include "SkDeviceImageFilterProxy.h"
22 #include "SkDrawProcs.h" 21 #include "SkDrawProcs.h"
23 #include "SkErrorInternals.h" 22 #include "SkErrorInternals.h"
24 #include "SkGlyphCache.h" 23 #include "SkGlyphCache.h"
25 #include "SkGrTexturePixelRef.h" 24 #include "SkGrTexturePixelRef.h"
26 #include "SkImage_Base.h" 25 #include "SkImage_Base.h"
27 #include "SkImageFilter.h" 26 #include "SkImageFilter.h"
28 #include "SkLayerInfo.h" 27 #include "SkLayerInfo.h"
29 #include "SkMaskFilter.h" 28 #include "SkMaskFilter.h"
30 #include "SkPathEffect.h" 29 #include "SkPathEffect.h"
31 #include "SkPicture.h" 30 #include "SkPicture.h"
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 1235
1237 bool SkGpuDevice::filterTexture(GrContext* context, GrTexture* texture, 1236 bool SkGpuDevice::filterTexture(GrContext* context, GrTexture* texture,
1238 int width, int height, 1237 int width, int height,
1239 const SkImageFilter* filter, 1238 const SkImageFilter* filter,
1240 const SkImageFilter::Context& ctx, 1239 const SkImageFilter::Context& ctx,
1241 SkBitmap* result, SkIPoint* offset) { 1240 SkBitmap* result, SkIPoint* offset) {
1242 SkASSERT(filter); 1241 SkASSERT(filter);
1243 1242
1244 // FIXME: plumb actual surface props such that we don't have to lie about th e flags here 1243 // FIXME: plumb actual surface props such that we don't have to lie about th e flags here
1245 // (https://code.google.com/p/skia/issues/detail?id=3148). 1244 // (https://code.google.com/p/skia/issues/detail?id=3148).
1246 SkDeviceImageFilterProxy proxy(this, SkSurfaceProps(0, getLeakyProperties(). pixelGeometry())); 1245 SkImageFilter::Proxy proxy(this, SkSurfaceProps(0, getLeakyProperties().pixe lGeometry()));
1247 1246
1248 if (filter->canFilterImageGPU()) { 1247 if (filter->canFilterImageGPU()) {
1249 return filter->filterImageGPU(&proxy, wrap_texture(texture, width, heigh t), 1248 return filter->filterImageGPU(&proxy, wrap_texture(texture, width, heigh t),
1250 ctx, result, offset); 1249 ctx, result, offset);
1251 } else { 1250 } else {
1252 return false; 1251 return false;
1253 } 1252 }
1254 } 1253 }
1255 1254
1256 void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap, 1255 void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
1781 #endif 1780 #endif
1782 } 1781 }
1783 1782
1784 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { 1783 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() {
1785 // We always return a transient cache, so it is freed after each 1784 // We always return a transient cache, so it is freed after each
1786 // filter traversal. 1785 // filter traversal.
1787 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); 1786 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize);
1788 } 1787 }
1789 1788
1790 #endif 1789 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698