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

Side by Side Diff: experimental/SkV8Example/DrawingMethods.cpp

Issue 661033005: SkV8Sample: Now with Path2D and Path2DBuilder. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: path* Created 6 years, 1 month 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 | experimental/SkV8Example/Path2D.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 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
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 <v8.h> 9 #include <v8.h>
10 10
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 Path2D* path = static_cast<Path2D*>(ptr); 107 Path2D* path = static_cast<Path2D*>(ptr);
108 if (NULL == path) { 108 if (NULL == path) {
109 return; 109 return;
110 } 110 }
111 // TODO(jcgregorio) Add support for Paint2D parameter after Paint2D is 111 // TODO(jcgregorio) Add support for Paint2D parameter after Paint2D is
112 // implemented. 112 // implemented.
113 SkPaint fillStyle; 113 SkPaint fillStyle;
114 fillStyle.setColor(SK_ColorBLACK); 114 fillStyle.setColor(SK_ColorBLACK);
115 fillStyle.setAntiAlias(true); 115 fillStyle.setAntiAlias(true);
116 fillStyle.setStyle(SkPaint::kFill_Style); 116 fillStyle.setStyle(SkPaint::kFill_Style);
117 canvas->drawPath(path->getSkPath(), fillStyle); 117 canvas->drawPath(*(path->path()), fillStyle);
118 } 118 }
119 119
120 120
121 void DrawingMethods::GetWidth(v8::Local<v8::String> name, 121 void DrawingMethods::GetWidth(v8::Local<v8::String> name,
122 const v8::PropertyCallbackInfo<v8::Value>& info) { 122 const v8::PropertyCallbackInfo<v8::Value>& info) {
123 DrawingMethods* drawingMethods = Unwrap(info.This()); 123 DrawingMethods* drawingMethods = Unwrap(info.This());
124 SkCanvas* canvas = drawingMethods->getCanvas(); 124 SkCanvas* canvas = drawingMethods->getCanvas();
125 if (NULL == canvas) { 125 if (NULL == canvas) {
126 return; 126 return;
127 } 127 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 163
164 // Add methods. 164 // Add methods.
165 ADD_METHOD("save", Save); 165 ADD_METHOD("save", Save);
166 ADD_METHOD("restore", Restore); 166 ADD_METHOD("restore", Restore);
167 ADD_METHOD("rotate", Rotate); 167 ADD_METHOD("rotate", Rotate);
168 ADD_METHOD("translate", Translate); 168 ADD_METHOD("translate", Translate);
169 ADD_METHOD("resetTransform", ResetTransform); 169 ADD_METHOD("resetTransform", ResetTransform);
170 170
171 ADD_METHOD("drawPath", DrawPath); 171 ADD_METHOD("drawPath", DrawPath);
172 } 172 }
OLDNEW
« no previous file with comments | « no previous file | experimental/SkV8Example/Path2D.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698