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

Side by Side Diff: samplecode/SampleFatBits.cpp

Issue 2355483002: abstract name of clipping ops, to transtion to a more restricted set (Closed)
Patch Set: no need for ifdef for globals Created 4 years, 3 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 | « 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 "sk_tool_utils.h" 8 #include "sk_tool_utils.h"
9 #include "SampleCode.h" 9 #include "SampleCode.h"
10 #include "SkView.h" 10 #include "SkView.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 apply_grid(pts, 2); 251 apply_grid(pts, 2);
252 } 252 }
253 253
254 erase(fMinSurface.get()); 254 erase(fMinSurface.get());
255 this->setupPaint(&paint); 255 this->setupPaint(&paint);
256 paint.setColor(FAT_PIXEL_COLOR); 256 paint.setColor(FAT_PIXEL_COLOR);
257 if (fUseClip) { 257 if (fUseClip) {
258 fMinSurface->getCanvas()->save(); 258 fMinSurface->getCanvas()->save();
259 SkRect r = fClipRect; 259 SkRect r = fClipRect;
260 r.inset(SK_Scalar1/3, SK_Scalar1/3); 260 r.inset(SK_Scalar1/3, SK_Scalar1/3);
261 fMinSurface->getCanvas()->clipRect(r, SkRegion::kIntersect_Op, true); 261 fMinSurface->getCanvas()->clipRect(r, SkCanvas::kIntersect_Op, true);
262 } 262 }
263 fMinSurface->getCanvas()->drawLine(pts[0].fX, pts[0].fY, pts[1].fX, pts[1].f Y, paint); 263 fMinSurface->getCanvas()->drawLine(pts[0].fX, pts[0].fY, pts[1].fX, pts[1].f Y, paint);
264 if (fUseClip) { 264 if (fUseClip) {
265 fMinSurface->getCanvas()->restore(); 265 fMinSurface->getCanvas()->restore();
266 } 266 }
267 this->copyMinToMax(); 267 this->copyMinToMax();
268 268
269 SkCanvas* max = fMaxSurface->getCanvas(); 269 SkCanvas* max = fMaxSurface->getCanvas();
270 270
271 fMatrix.mapPoints(pts, 2); 271 fMatrix.mapPoints(pts, 2);
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 497
498 private: 498 private:
499 499
500 typedef SampleView INHERITED; 500 typedef SampleView INHERITED;
501 }; 501 };
502 502
503 ////////////////////////////////////////////////////////////////////////////// 503 //////////////////////////////////////////////////////////////////////////////
504 504
505 static SkView* MyFactory() { return new DrawLineView; } 505 static SkView* MyFactory() { return new DrawLineView; }
506 static SkViewRegister reg(MyFactory); 506 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