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

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

Issue 1847583002: Update SkMergeImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to To Created 4 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
« no previous file with comments | « src/effects/SkMagnifierImageFilter.cpp ('k') | src/effects/SkMergeImageFilter.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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 return nullptr; 90 return nullptr;
91 } 91 }
92 SkScalar gain = buffer.readScalar(); 92 SkScalar gain = buffer.readScalar();
93 SkScalar bias = buffer.readScalar(); 93 SkScalar bias = buffer.readScalar();
94 SkIPoint kernelOffset; 94 SkIPoint kernelOffset;
95 kernelOffset.fX = buffer.readInt(); 95 kernelOffset.fX = buffer.readInt();
96 kernelOffset.fY = buffer.readInt(); 96 kernelOffset.fY = buffer.readInt();
97 TileMode tileMode = (TileMode)buffer.readInt(); 97 TileMode tileMode = (TileMode)buffer.readInt();
98 bool convolveAlpha = buffer.readBool(); 98 bool convolveAlpha = buffer.readBool();
99 return Create(kernelSize, kernel.get(), gain, bias, kernelOffset, tileMode, convolveAlpha, 99 return Create(kernelSize, kernel.get(), gain, bias, kernelOffset, tileMode, convolveAlpha,
100 common.getInput(0), &common.cropRect()); 100 common.getInput(0).get(), &common.cropRect());
101 } 101 }
102 102
103 void SkMatrixConvolutionImageFilter::flatten(SkWriteBuffer& buffer) const { 103 void SkMatrixConvolutionImageFilter::flatten(SkWriteBuffer& buffer) const {
104 this->INHERITED::flatten(buffer); 104 this->INHERITED::flatten(buffer);
105 buffer.writeInt(fKernelSize.fWidth); 105 buffer.writeInt(fKernelSize.fWidth);
106 buffer.writeInt(fKernelSize.fHeight); 106 buffer.writeInt(fKernelSize.fHeight);
107 buffer.writeScalarArray(fKernel, fKernelSize.fWidth * fKernelSize.fHeight); 107 buffer.writeScalarArray(fKernel, fKernelSize.fWidth * fKernelSize.fHeight);
108 buffer.writeScalar(fGain); 108 buffer.writeScalar(fGain);
109 buffer.writeScalar(fBias); 109 buffer.writeScalar(fBias);
110 buffer.writeInt(fKernelOffset.fX); 110 buffer.writeInt(fKernelOffset.fX);
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 str->appendf("%f ", fKernel[y * fKernelSize.width() + x]); 390 str->appendf("%f ", fKernel[y * fKernelSize.width() + x]);
391 } 391 }
392 } 392 }
393 str->appendf(")"); 393 str->appendf(")");
394 str->appendf("gain: %f bias: %f ", fGain, fBias); 394 str->appendf("gain: %f bias: %f ", fGain, fBias);
395 str->appendf("offset: (%d, %d) ", fKernelOffset.fX, fKernelOffset.fY); 395 str->appendf("offset: (%d, %d) ", fKernelOffset.fX, fKernelOffset.fY);
396 str->appendf("convolveAlpha: %s", fConvolveAlpha ? "true" : "false"); 396 str->appendf("convolveAlpha: %s", fConvolveAlpha ? "true" : "false");
397 str->append(")"); 397 str->append(")");
398 } 398 }
399 #endif 399 #endif
OLDNEW
« no previous file with comments | « src/effects/SkMagnifierImageFilter.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698