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

Side by Side Diff: samplecode/SamplePictFile.cpp

Issue 149463009: Adding int cast to prevent warning (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | 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 2011 Google Inc. 2 * Copyright 2011 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 "SkDumpCanvas.h" 9 #include "SkDumpCanvas.h"
10 #include "SkView.h" 10 #include "SkView.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 virtual bool onEvent(const SkEvent& evt) SK_OVERRIDE { 88 virtual bool onEvent(const SkEvent& evt) SK_OVERRIDE {
89 if (evt.isType("PictFileView::toggleBBox")) { 89 if (evt.isType("PictFileView::toggleBBox")) {
90 fBBox = (BBoxType)((fBBox + 1) % kBBoxTypeCount); 90 fBBox = (BBoxType)((fBBox + 1) % kBBoxTypeCount);
91 return true; 91 return true;
92 } 92 }
93 return this->INHERITED::onEvent(evt); 93 return this->INHERITED::onEvent(evt);
94 } 94 }
95 95
96 virtual void onDrawContent(SkCanvas* canvas) SK_OVERRIDE { 96 virtual void onDrawContent(SkCanvas* canvas) SK_OVERRIDE {
97 SkASSERT(fBBox < kBBoxTypeCount); 97 SkASSERT(static_cast<int>(fBBox) < kBBoxTypeCount);
98 SkPicture** picture = fPictures + fBBox; 98 SkPicture** picture = fPictures + fBBox;
99 99
100 if (!*picture) { 100 if (!*picture) {
101 *picture = LoadPicture(fFilename.c_str(), fBBox); 101 *picture = LoadPicture(fFilename.c_str(), fBBox);
102 } 102 }
103 if (*picture) { 103 if (*picture) {
104 canvas->drawPicture(**picture); 104 canvas->drawPicture(**picture);
105 } 105 }
106 } 106 }
107 107
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 SampleView* CreateSamplePictFileView(const char filename[]) { 202 SampleView* CreateSamplePictFileView(const char filename[]) {
203 return new PictFileView(filename); 203 return new PictFileView(filename);
204 } 204 }
205 205
206 ////////////////////////////////////////////////////////////////////////////// 206 //////////////////////////////////////////////////////////////////////////////
207 207
208 #if 0 208 #if 0
209 static SkView* MyFactory() { return new PictFileView; } 209 static SkView* MyFactory() { return new PictFileView; }
210 static SkViewRegister reg(MyFactory); 210 static SkViewRegister reg(MyFactory);
211 #endif 211 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698