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

Side by Side Diff: gm/composeshader.cpp

Issue 221953002: resize canvas for GM + typo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: code rebase Created 6 years, 8 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 | « gm/aaclip.cpp ('k') | gm/peekpixels.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 2012 Google Inc. 3 * Copyright 2012 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 8
9 #include "gm.h" 9 #include "gm.h"
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 virtual ~ShaderGM() { 49 virtual ~ShaderGM() {
50 SkSafeUnref(fShader); 50 SkSafeUnref(fShader);
51 } 51 }
52 52
53 protected: 53 protected:
54 virtual SkString onShortName() SK_OVERRIDE { 54 virtual SkString onShortName() SK_OVERRIDE {
55 return SkString("composeshader"); 55 return SkString("composeshader");
56 } 56 }
57 57
58 virtual SkISize onISize() SK_OVERRIDE { 58 virtual SkISize onISize() SK_OVERRIDE {
59 return make_isize(640, 480); 59 return make_isize(120, 120);
60 } 60 }
61 61
62 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 62 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
63 63
64 SkPaint paint; 64 SkPaint paint;
65 65
66 paint.setColor(SK_ColorGREEN); 66 paint.setColor(SK_ColorGREEN);
67 canvas->drawRectCoords(0, 0, SkIntToScalar(100), SkIntToScalar(100), pai nt); 67 canvas->drawRectCoords(0, 0, SkIntToScalar(100), SkIntToScalar(100), pai nt);
68 paint.setShader(fShader); 68 paint.setShader(fShader);
69 canvas->drawRectCoords(0, 0, SkIntToScalar(100), SkIntToScalar(100), pai nt); 69 canvas->drawRectCoords(0, 0, SkIntToScalar(100), SkIntToScalar(100), pai nt);
70 } 70 }
71 71
72 private: 72 private:
73 SkShader* fShader; 73 SkShader* fShader;
74 typedef GM INHERITED ; 74 typedef GM INHERITED ;
75 }; 75 };
76 76
77 ////////////////////////////////////////////////////////////////////////////// 77 //////////////////////////////////////////////////////////////////////////////
78 78
79 static GM* MyFactory(void*) { return new ShaderGM; } 79 static GM* MyFactory(void*) { return new ShaderGM; }
80 static GMRegistry reg(MyFactory); 80 static GMRegistry reg(MyFactory);
81 81
82 } // namespace 82 } // namespace
OLDNEW
« no previous file with comments | « gm/aaclip.cpp ('k') | gm/peekpixels.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698