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

Side by Side Diff: src/effects/SkMatrixConvolutionImageFilter.cpp

Issue 13602013: Allow single-pass filters (which use asNewEffect()) to participate in the image filter DAG. This w… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Remove SkSinglePassImageFilter class; move impl into SkImageFilter::filterImageGPU(). Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
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 "SkMatrixConvolutionImageFilter.h" 8 #include "SkMatrixConvolutionImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 return GrMatrixConvolutionEffect::Create(textures[texIdx], 553 return GrMatrixConvolutionEffect::Create(textures[texIdx],
554 kernelSize, 554 kernelSize,
555 kernel.get(), 555 kernel.get(),
556 gain, 556 gain,
557 bias, 557 bias,
558 target, 558 target,
559 tileMode, 559 tileMode,
560 convolveAlpha); 560 convolveAlpha);
561 } 561 }
562 562
563 bool SkMatrixConvolutionImageFilter::asNewEffect(GrEffectRef** effect, 563 bool SkMatrixConvolutionImageFilter::canFilterImageGPU() const {
564 GrTexture* texture) const { 564 return fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE;
565 bool ok = fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE; 565 }
566 if (ok && effect) { 566
567 *effect = GrMatrixConvolutionEffect::Create(texture, 567 GrEffectRef* SkMatrixConvolutionImageFilter::asNewEffect(GrTexture* texture) con st {
568 fKernelSize, 568 SkASSERT(fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE);
569 fKernel, 569 return GrMatrixConvolutionEffect::Create(texture,
570 fGain, 570 fKernelSize,
571 fBias, 571 fKernel,
572 fTarget, 572 fGain,
573 fTileMode, 573 fBias,
574 fConvolveAlpha); 574 fTarget,
575 } 575 fTileMode,
576 return ok; 576 fConvolveAlpha);
577 } 577 }
578 578
579 /////////////////////////////////////////////////////////////////////////////// 579 ///////////////////////////////////////////////////////////////////////////////
580 580
581 #endif 581 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698