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

Side by Side Diff: tests/ImageFilterTest.cpp

Issue 376953003: Clean up SkImageFilter constructors. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixed 100-col issues Created 6 years, 5 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/SkXfermodeImageFilter.cpp ('k') | no next file » | 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 2013 Google Inc. 2 * Copyright 2013 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkBitmapDevice.h" 9 #include "SkBitmapDevice.h"
10 #include "SkBitmapSource.h" 10 #include "SkBitmapSource.h"
(...skipping 26 matching lines...) Expand all
37 #include "SkGpuDevice.h" 37 #include "SkGpuDevice.h"
38 #endif 38 #endif
39 39
40 static const int kBitmapSize = 4; 40 static const int kBitmapSize = 4;
41 41
42 namespace { 42 namespace {
43 43
44 class MatrixTestImageFilter : public SkImageFilter { 44 class MatrixTestImageFilter : public SkImageFilter {
45 public: 45 public:
46 MatrixTestImageFilter(skiatest::Reporter* reporter, const SkMatrix& expected Matrix) 46 MatrixTestImageFilter(skiatest::Reporter* reporter, const SkMatrix& expected Matrix)
47 : SkImageFilter(0), fReporter(reporter), fExpectedMatrix(expectedMatrix) { 47 : SkImageFilter(0, NULL), fReporter(reporter), fExpectedMatrix(expectedMat rix) {
48 } 48 }
49 49
50 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context& ctx, 50 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context& ctx,
51 SkBitmap* result, SkIPoint* offset) const SK_OVER RIDE { 51 SkBitmap* result, SkIPoint* offset) const SK_OVER RIDE {
52 REPORTER_ASSERT(fReporter, ctx.ctm() == fExpectedMatrix); 52 REPORTER_ASSERT(fReporter, ctx.ctm() == fExpectedMatrix);
53 return true; 53 return true;
54 } 54 }
55 55
56 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(MatrixTestImageFilter) 56 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(MatrixTestImageFilter)
57 57
58 protected: 58 protected:
59 explicit MatrixTestImageFilter(SkReadBuffer& buffer) : SkImageFilter(0) { 59 explicit MatrixTestImageFilter(SkReadBuffer& buffer) : SkImageFilter(0, NULL ) {
60 fReporter = static_cast<skiatest::Reporter*>(buffer.readFunctionPtr()); 60 fReporter = static_cast<skiatest::Reporter*>(buffer.readFunctionPtr());
61 buffer.readMatrix(&fExpectedMatrix); 61 buffer.readMatrix(&fExpectedMatrix);
62 } 62 }
63 63
64 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE { 64 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE {
65 buffer.writeFunctionPtr(fReporter); 65 buffer.writeFunctionPtr(fReporter);
66 buffer.writeMatrix(fExpectedMatrix); 66 buffer.writeMatrix(fExpectedMatrix);
67 } 67 }
68 68
69 private: 69 private:
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 } 761 }
762 762
763 DEF_GPUTEST(XfermodeImageFilterCroppedInputGPU, reporter, factory) { 763 DEF_GPUTEST(XfermodeImageFilterCroppedInputGPU, reporter, factory) {
764 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp e>(0)); 764 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp e>(0));
765 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, 765 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context,
766 SkImageInfo::MakeN32Pre mul(1, 1), 766 SkImageInfo::MakeN32Pre mul(1, 1),
767 0)); 767 0));
768 test_xfermode_cropped_input(device, reporter); 768 test_xfermode_cropped_input(device, reporter);
769 } 769 }
770 #endif 770 #endif
OLDNEW
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698