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

Side by Side Diff: samplecode/SampleFatBits.cpp

Issue 1232463006: Fix up -Winconsistent-missing-override (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: llvm_coverage_build Created 5 years, 5 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/SampleCamera.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 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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 return true; 439 return true;
440 case 't': 440 case 't':
441 fFB.setTriangle(!fFB.getTriangle()); 441 fFB.setTriangle(!fFB.getTriangle());
442 this->inval(NULL); 442 this->inval(NULL);
443 return true; 443 return true;
444 } 444 }
445 } 445 }
446 return this->INHERITED::onQuery(evt); 446 return this->INHERITED::onQuery(evt);
447 } 447 }
448 448
449 virtual void onDrawContent(SkCanvas* canvas) { 449 void onDrawContent(SkCanvas* canvas) override {
450 fFB.drawBG(canvas); 450 fFB.drawBG(canvas);
451 if (fFB.getTriangle()) { 451 if (fFB.getTriangle()) {
452 fFB.drawTriangle(canvas, fPts); 452 fFB.drawTriangle(canvas, fPts);
453 } 453 }
454 else if (fIsRect) { 454 else if (fIsRect) {
455 fFB.drawRect(canvas, fPts); 455 fFB.drawRect(canvas, fPts);
456 } else { 456 } else {
457 fFB.drawLine(canvas, fPts); 457 fFB.drawLine(canvas, fPts);
458 } 458 }
459 fFB.drawFG(canvas); 459 fFB.drawFG(canvas);
460 460
461 { 461 {
462 SkString str; 462 SkString str;
463 str.printf("%s %s %s %s", 463 str.printf("%s %s %s %s",
464 fFB.getAA() ? "AA" : "BW", 464 fFB.getAA() ? "AA" : "BW",
465 FatBits::kHair_Style == fFB.getStyle() ? "Hair" : "Stroke ", 465 FatBits::kHair_Style == fFB.getStyle() ? "Hair" : "Stroke ",
466 fFB.getUseGPU() ? "GPU" : "CPU", 466 fFB.getUseGPU() ? "GPU" : "CPU",
467 fFB.getUseClip() ? "clip" : "noclip"); 467 fFB.getUseClip() ? "clip" : "noclip");
468 SkPaint paint; 468 SkPaint paint;
469 paint.setAntiAlias(true); 469 paint.setAntiAlias(true);
470 paint.setTextSize(16); 470 paint.setTextSize(16);
471 paint.setColor(SK_ColorBLUE); 471 paint.setColor(SK_ColorBLUE);
472 canvas->drawText(str.c_str(), str.size(), 10, 16, paint); 472 canvas->drawText(str.c_str(), str.size(), 10, 16, paint);
473 } 473 }
474 } 474 }
475 475
476 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, 476 SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned modi) ove rride {
477 unsigned modi) override {
478 SkPoint pt = { x, y }; 477 SkPoint pt = { x, y };
479 int index = -1; 478 int index = -1;
480 int count = fFB.getTriangle() ? 3 : 2; 479 int count = fFB.getTriangle() ? 3 : 2;
481 SkScalar tol = 12; 480 SkScalar tol = 12;
482 481
483 for (int i = 0; i < count; ++i) { 482 for (int i = 0; i < count; ++i) {
484 if (fPts[i].equalsWithinTolerance(pt, tol)) { 483 if (fPts[i].equalsWithinTolerance(pt, tol)) {
485 index = i; 484 index = i;
486 break; 485 break;
487 } 486 }
(...skipping 18 matching lines...) Expand all
506 505
507 private: 506 private:
508 507
509 typedef SampleView INHERITED; 508 typedef SampleView INHERITED;
510 }; 509 };
511 510
512 ////////////////////////////////////////////////////////////////////////////// 511 //////////////////////////////////////////////////////////////////////////////
513 512
514 static SkView* MyFactory() { return new DrawLineView; } 513 static SkView* MyFactory() { return new DrawLineView; }
515 static SkViewRegister reg(MyFactory); 514 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleCamera.cpp ('k') | samplecode/SampleLayers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698