| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |