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

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: Use fXferMode 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') | 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 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 #include "gm.h" 9 #include "gm.h"
10 #include "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 return SkString("patch_primitive"); 80 return SkString("patch_primitive");
81 } 81 }
82 82
83 virtual SkISize onISize() SK_OVERRIDE { 83 virtual SkISize onISize() SK_OVERRIDE {
84 return SkISize::Make(800, 800); 84 return SkISize::Make(800, 800);
85 } 85 }
86 86
87 virtual uint32_t onGetFlags() const SK_OVERRIDE { 87 virtual uint32_t onGetFlags() const SK_OVERRIDE {
88 return kSkipTiled_Flag; 88 return kSkipTiled_Flag;
89 } 89 }
90 90
91 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 91 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
92 92
93 SkPaint paint; 93 SkPaint paint;
94 94
95 // The order of the colors and points is clockwise starting at upper-lef t corner. 95 // The order of the colors and points is clockwise starting at upper-lef t corner.
96 const SkPoint cubics[SkPatchUtils::kNumCtrlPts] = { 96 const SkPoint cubics[SkPatchUtils::kNumCtrlPts] = {
97 //top points 97 //top points
98 {100,100},{150,50},{250,150}, {300,100}, 98 {100,100},{150,50},{250,150}, {300,100},
99 //right points 99 //right points
100 {250, 150},{350,250}, 100 {250, 150},{350,250},
101 //bottom points 101 //bottom points
102 {300,300},{250,250},{150,350},{100,300}, 102 {300,300},{250,250},{150,350},{100,300},
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 canvas->restore(); 154 canvas->restore();
155 } 155 }
156 156
157 private: 157 private:
158 typedef GM INHERITED; 158 typedef GM INHERITED;
159 }; 159 };
160 160
161 DEF_GM(return SkNEW(SkPatchGM); ) 161 DEF_GM(return SkNEW(SkPatchGM); )
162 162
163 } 163 }
OLDNEW
« no previous file with comments | « no previous file | gm/patchgrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698