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

Side by Side Diff: gm/matrixconvolution.cpp

Issue 31083002: Fix for cropped matrix convolution for BottomLeft render targets. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: matrixconvolution GM: move crop rect up, so it's not symmetric in Y Created 7 years, 2 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
« no previous file with comments | « no previous file | src/effects/SkMatrixConvolutionImageFilter.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 Google Inc. 2 * Copyright 2012 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 "gm.h" 8 #include "gm.h"
9 #include "SkColor.h" 9 #include "SkColor.h"
10 #include "SkMatrixConvolutionImageFilter.h" 10 #include "SkMatrixConvolutionImageFilter.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 } 86 }
87 canvas->clear(0x00000000); 87 canvas->clear(0x00000000);
88 SkIPoint target = SkIPoint::Make(1, 0); 88 SkIPoint target = SkIPoint::Make(1, 0);
89 for (int x = 10; x < 310; x += 100) { 89 for (int x = 10; x < 310; x += 100) {
90 this->draw(canvas, x, 10, target, MCIF::kClamp_TileMode, true); 90 this->draw(canvas, x, 10, target, MCIF::kClamp_TileMode, true);
91 this->draw(canvas, x, 110, target, MCIF::kClampToBlack_TileMode, tru e); 91 this->draw(canvas, x, 110, target, MCIF::kClampToBlack_TileMode, tru e);
92 this->draw(canvas, x, 210, target, MCIF::kRepeat_TileMode, true); 92 this->draw(canvas, x, 210, target, MCIF::kRepeat_TileMode, true);
93 target.fY++; 93 target.fY++;
94 } 94 }
95 target.fY = 1; 95 target.fY = 1;
96 SkImageFilter::CropRect rect(SkRect::MakeXYWH(10, 10, 60, 60)); 96 SkImageFilter::CropRect rect(SkRect::MakeXYWH(10, 5, 60, 60));
97 this->draw(canvas, 310, 10, target, MCIF::kClamp_TileMode, true, &rect); 97 this->draw(canvas, 310, 10, target, MCIF::kClamp_TileMode, true, &rect);
98 this->draw(canvas, 310, 110, target, MCIF::kClampToBlack_TileMode, true, &rect); 98 this->draw(canvas, 310, 110, target, MCIF::kClampToBlack_TileMode, true, &rect);
99 this->draw(canvas, 310, 210, target, MCIF::kRepeat_TileMode, true, &rect ); 99 this->draw(canvas, 310, 210, target, MCIF::kRepeat_TileMode, true, &rect );
100 100
101 this->draw(canvas, 410, 10, target, MCIF::kClamp_TileMode, false); 101 this->draw(canvas, 410, 10, target, MCIF::kClamp_TileMode, false);
102 this->draw(canvas, 410, 110, target, MCIF::kClampToBlack_TileMode, false ); 102 this->draw(canvas, 410, 110, target, MCIF::kClampToBlack_TileMode, false );
103 this->draw(canvas, 410, 210, target, MCIF::kRepeat_TileMode, false); 103 this->draw(canvas, 410, 210, target, MCIF::kRepeat_TileMode, false);
104 } 104 }
105 105
106 private: 106 private:
107 typedef GM INHERITED; 107 typedef GM INHERITED;
108 SkBitmap fBitmap; 108 SkBitmap fBitmap;
109 bool fInitialized; 109 bool fInitialized;
110 }; 110 };
111 111
112 ////////////////////////////////////////////////////////////////////////////// 112 //////////////////////////////////////////////////////////////////////////////
113 113
114 static GM* MyFactory(void*) { return new MatrixConvolutionGM; } 114 static GM* MyFactory(void*) { return new MatrixConvolutionGM; }
115 static GMRegistry reg(MyFactory); 115 static GMRegistry reg(MyFactory);
116 116
117 } 117 }
OLDNEW
« no previous file with comments | « no previous file | src/effects/SkMatrixConvolutionImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698