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

Side by Side Diff: samplecode/SampleIdentityScale.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/SampleFatBits.cpp ('k') | samplecode/SampleLayers.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 2014 Google Inc. 2 * Copyright 2014 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 "DecodeFile.h" 8 #include "DecodeFile.h"
9 #include "gm.h" 9 #include "gm.h"
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 const char *text; 58 const char *text;
59 59
60 canvas->save(); 60 canvas->save();
61 if (use_scale) { 61 if (use_scale) {
62 text = "Scaled = 1"; 62 text = "Scaled = 1";
63 } else { 63 } else {
64 64
65 SkRect r = { 100, 100, 356, 356 }; 65 SkRect r = { 100, 100, 356, 356 };
66 SkPath clipPath; 66 SkPath clipPath;
67 clipPath.addRoundRect(r, SkIntToScalar(5), SkIntToScalar(5)); 67 clipPath.addRoundRect(r, SkIntToScalar(5), SkIntToScalar(5));
68 canvas->clipPath(clipPath, SkRegion::kIntersect_Op, SkToBool(1)); 68 canvas->clipPath(clipPath, SkCanvas::kIntersect_Op, SkToBool(1));
69 text = "Scaled = 0"; 69 text = "Scaled = 0";
70 } 70 }
71 canvas->drawBitmap( fBM, 100, 100, &paint ); 71 canvas->drawBitmap( fBM, 100, 100, &paint );
72 canvas->restore(); 72 canvas->restore();
73 canvas->drawText( text, strlen(text), 100, 400, paint ); 73 canvas->drawText( text, strlen(text), 100, 400, paint );
74 this->inval(nullptr); 74 this->inval(nullptr);
75 } 75 }
76 76
77 private: 77 private:
78 typedef SampleView INHERITED; 78 typedef SampleView INHERITED;
79 }; 79 };
80 80
81 ////////////////////////////////////////////////////////////////////////////// 81 //////////////////////////////////////////////////////////////////////////////
82 82
83 static SkView* MyFactory() { return new IdentityScaleView("mandrill_256.png"); } 83 static SkView* MyFactory() { return new IdentityScaleView("mandrill_256.png"); }
84 static SkViewRegister reg(MyFactory); 84 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleFatBits.cpp ('k') | samplecode/SampleLayers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698