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

Side by Side Diff: samplecode/SampleFilterFuzz.cpp

Issue 830083002: remove unused drawData (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 | « include/utils/SkProxyCanvas.h ('k') | samplecode/SamplePicture.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 2013 Google Inc. 2 * Copyright 2013 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 #include "SampleCode.h" 7 #include "SampleCode.h"
8 #include "SkAlphaThresholdFilter.h" 8 #include "SkAlphaThresholdFilter.h"
9 #include "SkBitmapSource.h" 9 #include "SkBitmapSource.h"
10 #include "SkBlurImageFilter.h" 10 #include "SkBlurImageFilter.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 241 }
242 242
243 static void drawSomething(SkCanvas* canvas) { 243 static void drawSomething(SkCanvas* canvas) {
244 SkPaint paint; 244 SkPaint paint;
245 245
246 canvas->save(); 246 canvas->save();
247 canvas->scale(0.5f, 0.5f); 247 canvas->scale(0.5f, 0.5f);
248 canvas->drawBitmap(make_bitmap(), 0, 0, NULL); 248 canvas->drawBitmap(make_bitmap(), 0, 0, NULL);
249 canvas->restore(); 249 canvas->restore();
250 250
251 const char beforeStr[] = "before circle";
252 const char afterStr[] = "after circle";
253
254 paint.setAntiAlias(true); 251 paint.setAntiAlias(true);
255 252
256 paint.setColor(SK_ColorRED); 253 paint.setColor(SK_ColorRED);
257 canvas->drawData(beforeStr, sizeof(beforeStr));
258 canvas->drawCircle(SkIntToScalar(kBitmapSize/2), SkIntToScalar(kBitmapSize/2 ), SkIntToScalar(kBitmapSize/3), paint); 254 canvas->drawCircle(SkIntToScalar(kBitmapSize/2), SkIntToScalar(kBitmapSize/2 ), SkIntToScalar(kBitmapSize/3), paint);
259 canvas->drawData(afterStr, sizeof(afterStr));
260 paint.setColor(SK_ColorBLACK); 255 paint.setColor(SK_ColorBLACK);
261 paint.setTextSize(SkIntToScalar(kBitmapSize/3)); 256 paint.setTextSize(SkIntToScalar(kBitmapSize/3));
262 canvas->drawText("Picture", 7, SkIntToScalar(kBitmapSize/2), SkIntToScalar(k BitmapSize/4), paint); 257 canvas->drawText("Picture", 7, SkIntToScalar(kBitmapSize/2), SkIntToScalar(k BitmapSize/4), paint);
263 } 258 }
264 259
265 static SkImageFilter* make_image_filter(bool canBeNull = true) { 260 static SkImageFilter* make_image_filter(bool canBeNull = true) {
266 SkImageFilter* filter = 0; 261 SkImageFilter* filter = 0;
267 262
268 // Add a 1 in 3 chance to get a NULL input 263 // Add a 1 in 3 chance to get a NULL input
269 if (canBeNull && (R(3) == 1)) { return filter; } 264 if (canBeNull && (R(3) == 1)) { return filter; }
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 } 514 }
520 515
521 private: 516 private:
522 typedef SkView INHERITED; 517 typedef SkView INHERITED;
523 }; 518 };
524 519
525 ////////////////////////////////////////////////////////////////////////////// 520 //////////////////////////////////////////////////////////////////////////////
526 521
527 static SkView* MyFactory() { return new ImageFilterFuzzView; } 522 static SkView* MyFactory() { return new ImageFilterFuzzView; }
528 static SkViewRegister reg(MyFactory); 523 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « include/utils/SkProxyCanvas.h ('k') | samplecode/SamplePicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698