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

Side by Side Diff: site/user/sample/hello.md

Issue 806653007: Fix up all the easy virtual ... SK_OVERRIDE cases. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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 | « samplecode/SampleVertices.cpp ('k') | src/animator/SkAnimate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Creating a Skia "Hello World!" 1 Creating a Skia "Hello World!"
2 ============================== 2 ==============================
3 3
4 This tutorial will guide you through the steps to create a Hello World Desktop 4 This tutorial will guide you through the steps to create a Hello World Desktop
5 application in Skia. 5 application in Skia.
6 6
7 Who this tutorial is for: 7 Who this tutorial is for:
8 ------------------------- 8 -------------------------
9 9
10 This will be useful to you if you want to create a window that can receive 10 This will be useful to you if you want to create a window that can receive
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 HelloTutorial(SkExampleWindow* window) 65 HelloTutorial(SkExampleWindow* window)
66 : SkExample(window) 66 : SkExample(window)
67 { 67 {
68 fName = "Tutorial"; // This is how Skia will find your example. 68 fName = "Tutorial"; // This is how Skia will find your example.
69 69
70 fWindow->setupBackend(SkExampleWindow::kGPU_DeviceType); 70 fWindow->setupBackend(SkExampleWindow::kGPU_DeviceType);
71 // Another option is the CPU backend: fWindow->setupBackend(kRaster_ DeviceType); 71 // Another option is the CPU backend: fWindow->setupBackend(kRaster_ DeviceType);
72 } 72 }
73 73
74 protected: 74 protected:
75 virtual void draw(SkCanvas* canvas) SK_OVERRIDE { 75 void draw(SkCanvas* canvas) SK_OVERRIDE {
76 // Clear background 76 // Clear background
77 canvas->drawColor(SK_ColorWHITE); 77 canvas->drawColor(SK_ColorWHITE);
78 78
79 SkPaint paint; 79 SkPaint paint;
80 // Draw a message with a nice black paint. 80 // Draw a message with a nice black paint.
81 paint.setFlags(SkPaint::kAntiAlias_Flag); 81 paint.setFlags(SkPaint::kAntiAlias_Flag);
82 paint.setColor(SK_ColorBLACK); 82 paint.setColor(SK_ColorBLACK);
83 paint.setTextSize(SkIntToScalar(20)); 83 paint.setTextSize(SkIntToScalar(20));
84 84
85 static const char message[] = "Hello World!"; 85 static const char message[] = "Hello World!";
(...skipping 28 matching lines...) Expand all
114 * Repeat Step 2 to update our gyp targets and build our example. 114 * Repeat Step 2 to update our gyp targets and build our example.
115 * Run the SkiaExamples, specifying the name of our new example: `$> out/Releas e/SkiaExamples --match Tutorial` 115 * Run the SkiaExamples, specifying the name of our new example: `$> out/Releas e/SkiaExamples --match Tutorial`
116 116
117 Step 5: How to iterate through multiple examples 117 Step 5: How to iterate through multiple examples
118 ------------------------------------------------ 118 ------------------------------------------------
119 119
120 If you did not specify an example with the --match flag, or if your match 120 If you did not specify an example with the --match flag, or if your match
121 string matches more than one example, you can use the *n* key to iterate 121 string matches more than one example, you can use the *n* key to iterate
122 through all of the examples registered. 122 through all of the examples registered.
123 123
OLDNEW
« no previous file with comments | « samplecode/SampleVertices.cpp ('k') | src/animator/SkAnimate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698