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

Side by Side Diff: gm/patch.cpp

Issue 451723003: SkPatchGrid interface (after SkPatch/SkPicture rebase). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Renamed GM to SKPatchGridGM and removed last mesh references in comments Created 6 years, 4 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 | gm/patchgrid.cpp » ('j') | include/core/SkPatchGrid.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 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 // This test only works with the GPU backend. 9 // This test only works with the GPU backend.
10 10
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 return SkString("patch_primitive"); 75 return SkString("patch_primitive");
76 } 76 }
77 77
78 virtual SkISize onISize() SK_OVERRIDE { 78 virtual SkISize onISize() SK_OVERRIDE {
79 return SkISize::Make(800, 800); 79 return SkISize::Make(800, 800);
80 } 80 }
81 81
82 virtual uint32_t onGetFlags() const SK_OVERRIDE { 82 virtual uint32_t onGetFlags() const SK_OVERRIDE {
83 return kSkipTiled_Flag; 83 return kSkipTiled_Flag;
84 } 84 }
85 85
86 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 86 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
87 87
88 SkPaint paint; 88 SkPaint paint;
89
90 // The order of the colors and points is clockwise starting at upper-lef t corner.
91 SkColor colors[SkPatch::kNumColors] = { 89 SkColor colors[SkPatch::kNumColors] = {
92 SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorCYAN 90 SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorCYAN
93 }; 91 };
94 SkPoint points[SkPatch::kNumCtrlPts] = { 92 SkPoint points[SkPatch::kNumCtrlPts] = {
95 //top points 93 //top points
96 {50,50},{75,20},{125,80}, {150,50}, 94 {50,50},{75,20},{125,80}, {150,50},
97 //right points 95 //right points
98 {120,75},{180,125}, 96 {120,75},{180,125},
99 //bottom points 97 //bottom points
100 {150,150},{125,120},{75,180},{50,150}, 98 {150,150},{125,120},{75,180},{50,150},
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 130
133 private: 131 private:
134 typedef GM INHERITED; 132 typedef GM INHERITED;
135 }; 133 };
136 134
137 DEF_GM(return SkNEW(SkPatchGM); ) 135 DEF_GM(return SkNEW(SkPatchGM); )
138 136
139 } 137 }
140 138
141 #endif 139 #endif
OLDNEW
« no previous file with comments | « no previous file | gm/patchgrid.cpp » ('j') | include/core/SkPatchGrid.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698