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

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: Fix return value of SkImageFilter::asNewEffect(). 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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::asNewEffect(GrEffectRef** effect,
564 GrTexture* texture) const { 564 GrTexture* texture) const {
565 bool ok = fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE; 565 if (!effect) {
566 if (ok && effect) { 566 return fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE;
567 *effect = GrMatrixConvolutionEffect::Create(texture,
568 fKernelSize,
569 fKernel,
570 fGain,
571 fBias,
572 fTarget,
573 fTileMode,
574 fConvolveAlpha);
575 } 567 }
576 return ok; 568 SkASSERT(fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE);
569 *effect = GrMatrixConvolutionEffect::Create(texture,
570 fKernelSize,
571 fKernel,
572 fGain,
573 fBias,
574 fTarget,
575 fTileMode,
576 fConvolveAlpha);
577 return true;
577 } 578 }
578 579
579 /////////////////////////////////////////////////////////////////////////////// 580 ///////////////////////////////////////////////////////////////////////////////
580 581
581 #endif 582 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698