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

Unified Diff: third_party/WebKit/Source/modules/canvas2d/CanvasGradient.cpp

Issue 2785203002: Split Gradient impl into separate classes (Closed)
Patch Set: review Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/canvas2d/CanvasGradient.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasGradient.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasGradient.cpp
index 2caa7508270d95560a92d67e4a22f439a26cf26a..a85cb21d3009a8df4e2d92a59ddad093115213aa 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasGradient.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasGradient.cpp
@@ -34,13 +34,14 @@
namespace blink {
CanvasGradient::CanvasGradient(const FloatPoint& p0, const FloatPoint& p1)
- : m_gradient(Gradient::create(p0, p1)) {}
+ : m_gradient(Gradient::createLinear(p0, p1)), m_isZeroSize(p0 == p1) {}
CanvasGradient::CanvasGradient(const FloatPoint& p0,
float r0,
const FloatPoint& p1,
float r1)
- : m_gradient(Gradient::create(p0, r0, p1, r1)) {}
+ : m_gradient(Gradient::createRadial(p0, r0, p1, r1)),
+ m_isZeroSize(p0 == p1 && r0 == r1) {}
void CanvasGradient::addColorStop(float value,
const String& colorString,
« no previous file with comments | « third_party/WebKit/Source/modules/canvas2d/CanvasGradient.h ('k') | third_party/WebKit/Source/platform/graphics/Gradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698