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

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

Issue 1540203002: Revert of change all factories to return their base-class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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/SkEmbossMaskFilter.cpp ('k') | tests/AsADashTest.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 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 29 matching lines...) Expand all
40 fTileMode(tileMode), 40 fTileMode(tileMode),
41 fConvolveAlpha(convolveAlpha) { 41 fConvolveAlpha(convolveAlpha) {
42 size_t size = (size_t) sk_64_mul(fKernelSize.width(), fKernelSize.height()); 42 size_t size = (size_t) sk_64_mul(fKernelSize.width(), fKernelSize.height());
43 fKernel = new SkScalar[size]; 43 fKernel = new SkScalar[size];
44 memcpy(fKernel, kernel, size * sizeof(SkScalar)); 44 memcpy(fKernel, kernel, size * sizeof(SkScalar));
45 SkASSERT(kernelSize.fWidth >= 1 && kernelSize.fHeight >= 1); 45 SkASSERT(kernelSize.fWidth >= 1 && kernelSize.fHeight >= 1);
46 SkASSERT(kernelOffset.fX >= 0 && kernelOffset.fX < kernelSize.fWidth); 46 SkASSERT(kernelOffset.fX >= 0 && kernelOffset.fX < kernelSize.fWidth);
47 SkASSERT(kernelOffset.fY >= 0 && kernelOffset.fY < kernelSize.fHeight); 47 SkASSERT(kernelOffset.fY >= 0 && kernelOffset.fY < kernelSize.fHeight);
48 } 48 }
49 49
50 SkImageFilter* SkMatrixConvolutionImageFilter::Create( 50 SkMatrixConvolutionImageFilter* SkMatrixConvolutionImageFilter::Create(
51 const SkISize& kernelSize, 51 const SkISize& kernelSize,
52 const SkScalar* kernel, 52 const SkScalar* kernel,
53 SkScalar gain, 53 SkScalar gain,
54 SkScalar bias, 54 SkScalar bias,
55 const SkIPoint& kernelOffset, 55 const SkIPoint& kernelOffset,
56 TileMode tileMode, 56 TileMode tileMode,
57 bool convolveAlpha, 57 bool convolveAlpha,
58 SkImageFilter* input, 58 SkImageFilter* input,
59 const CropRect* cropRect) { 59 const CropRect* cropRect) {
60 if (kernelSize.width() < 1 || kernelSize.height() < 1) { 60 if (kernelSize.width() < 1 || kernelSize.height() < 1) {
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 str->appendf("%f ", fKernel[y * fKernelSize.width() + x]); 388 str->appendf("%f ", fKernel[y * fKernelSize.width() + x]);
389 } 389 }
390 } 390 }
391 str->appendf(")"); 391 str->appendf(")");
392 str->appendf("gain: %f bias: %f ", fGain, fBias); 392 str->appendf("gain: %f bias: %f ", fGain, fBias);
393 str->appendf("offset: (%d, %d) ", fKernelOffset.fX, fKernelOffset.fY); 393 str->appendf("offset: (%d, %d) ", fKernelOffset.fX, fKernelOffset.fY);
394 str->appendf("convolveAlpha: %s", fConvolveAlpha ? "true" : "false"); 394 str->appendf("convolveAlpha: %s", fConvolveAlpha ? "true" : "false");
395 str->append(")"); 395 str->append(")");
396 } 396 }
397 #endif 397 #endif
OLDNEW
« no previous file with comments | « src/effects/SkEmbossMaskFilter.cpp ('k') | tests/AsADashTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698