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

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

Issue 1390913005: add applyFilter() to SkImage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: can't use +[] trick on windows :( Created 5 years, 2 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"
(...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 } 1388 }
1389 } 1389 }
1390 1390
1391 bool SkGpuDevice::filterTexture(GrContext* context, GrTexture* texture, 1391 bool SkGpuDevice::filterTexture(GrContext* context, GrTexture* texture,
1392 int width, int height, 1392 int width, int height,
1393 const SkImageFilter* filter, 1393 const SkImageFilter* filter,
1394 const SkImageFilter::Context& ctx, 1394 const SkImageFilter::Context& ctx,
1395 SkBitmap* result, SkIPoint* offset) { 1395 SkBitmap* result, SkIPoint* offset) {
1396 SkASSERT(filter); 1396 SkASSERT(filter);
1397 1397
1398 SkImageFilter::Proxy proxy(this); 1398 SkImageFilter::DeviceProxy proxy(this);
1399 1399
1400 if (filter->canFilterImageGPU()) { 1400 if (filter->canFilterImageGPU()) {
1401 return filter->filterImageGPU(&proxy, wrap_texture(texture, width, heigh t), 1401 return filter->filterImageGPU(&proxy, wrap_texture(texture, width, heigh t),
1402 ctx, result, offset); 1402 ctx, result, offset);
1403 } else { 1403 } else {
1404 return false; 1404 return false;
1405 } 1405 }
1406 } 1406 }
1407 1407
1408 void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap, 1408 void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
2025 #endif 2025 #endif
2026 } 2026 }
2027 2027
2028 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { 2028 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() {
2029 // We always return a transient cache, so it is freed after each 2029 // We always return a transient cache, so it is freed after each
2030 // filter traversal. 2030 // filter traversal.
2031 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); 2031 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize);
2032 } 2032 }
2033 2033
2034 #endif 2034 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698