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

Side by Side Diff: samplecode/SamplePicture.cpp

Issue 85463005: remove SkFloatToScalar macro (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add flag to expose SkFloatToScalar to chromium Created 7 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 | Annotate | Revision Log
« no previous file with comments | « samplecode/SampleHairline.cpp ('k') | samplecode/SamplePolyToPoly.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkDumpCanvas.h" 9 #include "SkDumpCanvas.h"
10 #include "SkView.h" 10 #include "SkView.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 SampleCode::TitleR(evt, "Picture"); 97 SampleCode::TitleR(evt, "Picture");
98 return true; 98 return true;
99 } 99 }
100 return this->INHERITED::onQuery(evt); 100 return this->INHERITED::onQuery(evt);
101 } 101 }
102 102
103 void drawSomething(SkCanvas* canvas) { 103 void drawSomething(SkCanvas* canvas) {
104 SkPaint paint; 104 SkPaint paint;
105 105
106 canvas->save(); 106 canvas->save();
107 canvas->scale(SkFloatToScalar(0.5f), SkFloatToScalar(0.5f)); 107 canvas->scale(0.5f, 0.5f);
108 canvas->drawBitmap(fBitmap, 0, 0, NULL); 108 canvas->drawBitmap(fBitmap, 0, 0, NULL);
109 canvas->restore(); 109 canvas->restore();
110 110
111 const char beforeStr[] = "before circle"; 111 const char beforeStr[] = "before circle";
112 const char afterStr[] = "after circle"; 112 const char afterStr[] = "after circle";
113 113
114 paint.setAntiAlias(true); 114 paint.setAntiAlias(true);
115 115
116 paint.setColor(SK_ColorRED); 116 paint.setColor(SK_ColorRED);
117 canvas->drawData(beforeStr, sizeof(beforeStr)); 117 canvas->drawData(beforeStr, sizeof(beforeStr));
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 SkPicture* fPicture; 191 SkPicture* fPicture;
192 SkPicture* fSubPicture; 192 SkPicture* fSubPicture;
193 193
194 typedef SampleView INHERITED; 194 typedef SampleView INHERITED;
195 }; 195 };
196 196
197 ////////////////////////////////////////////////////////////////////////////// 197 //////////////////////////////////////////////////////////////////////////////
198 198
199 static SkView* MyFactory() { return new PictureView; } 199 static SkView* MyFactory() { return new PictureView; }
200 static SkViewRegister reg(MyFactory); 200 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleHairline.cpp ('k') | samplecode/SamplePolyToPoly.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698