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

Side by Side Diff: samplecode/SampleFatBits.cpp

Issue 777643003: use ClipOp instead of SkRegion for clipping (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « samplecode/SampleComplexClip.cpp ('k') | samplecode/SampleIdentityScale.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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 apply_grid(pts, 2); 278 apply_grid(pts, 2);
279 } 279 }
280 280
281 erase(fMinSurface); 281 erase(fMinSurface);
282 this->setupPaint(&paint); 282 this->setupPaint(&paint);
283 paint.setColor(FAT_PIXEL_COLOR); 283 paint.setColor(FAT_PIXEL_COLOR);
284 if (fUseClip) { 284 if (fUseClip) {
285 fMinSurface->getCanvas()->save(); 285 fMinSurface->getCanvas()->save();
286 SkRect r = fClipRect; 286 SkRect r = fClipRect;
287 r.inset(SK_Scalar1/3, SK_Scalar1/3); 287 r.inset(SK_Scalar1/3, SK_Scalar1/3);
288 fMinSurface->getCanvas()->clipRect(r, SkRegion::kIntersect_Op, true); 288 fMinSurface->getCanvas()->clipRect(r, kIntersect_SkClipOp, true);
289 } 289 }
290 fMinSurface->getCanvas()->drawLine(pts[0].fX, pts[0].fY, pts[1].fX, pts[1].f Y, paint); 290 fMinSurface->getCanvas()->drawLine(pts[0].fX, pts[0].fY, pts[1].fX, pts[1].f Y, paint);
291 if (fUseClip) { 291 if (fUseClip) {
292 fMinSurface->getCanvas()->restore(); 292 fMinSurface->getCanvas()->restore();
293 } 293 }
294 this->copyMinToMax(); 294 this->copyMinToMax();
295 295
296 SkCanvas* max = fMaxSurface->getCanvas(); 296 SkCanvas* max = fMaxSurface->getCanvas();
297 297
298 fMatrix.mapPoints(pts, 2); 298 fMatrix.mapPoints(pts, 2);
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 516
517 private: 517 private:
518 518
519 typedef SampleView INHERITED; 519 typedef SampleView INHERITED;
520 }; 520 };
521 521
522 ////////////////////////////////////////////////////////////////////////////// 522 //////////////////////////////////////////////////////////////////////////////
523 523
524 static SkView* MyFactory() { return new DrawLineView; } 524 static SkView* MyFactory() { return new DrawLineView; }
525 static SkViewRegister reg(MyFactory); 525 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleComplexClip.cpp ('k') | samplecode/SampleIdentityScale.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698