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

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/CanvasGradient.h

Issue 2785203002: Split Gradient impl into separate classes (Closed)
Patch Set: review Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 float r0, 50 float r0,
51 const FloatPoint& p1, 51 const FloatPoint& p1,
52 float r1) { 52 float r1) {
53 return new CanvasGradient(p0, r0, p1, r1); 53 return new CanvasGradient(p0, r0, p1, r1);
54 } 54 }
55 55
56 Gradient* getGradient() const { return m_gradient.get(); } 56 Gradient* getGradient() const { return m_gradient.get(); }
57 57
58 void addColorStop(float value, const String& color, ExceptionState&); 58 void addColorStop(float value, const String& color, ExceptionState&);
59 59
60 bool isZeroSize() const { return m_isZeroSize; }
61
60 DEFINE_INLINE_TRACE() {} 62 DEFINE_INLINE_TRACE() {}
61 63
62 private: 64 private:
63 CanvasGradient(const FloatPoint& p0, const FloatPoint& p1); 65 CanvasGradient(const FloatPoint& p0, const FloatPoint& p1);
64 CanvasGradient(const FloatPoint& p0, 66 CanvasGradient(const FloatPoint& p0,
65 float r0, 67 float r0,
66 const FloatPoint& p1, 68 const FloatPoint& p1,
67 float r1); 69 float r1);
68 70
69 RefPtr<Gradient> m_gradient; 71 RefPtr<Gradient> m_gradient;
72 const bool m_isZeroSize;
70 }; 73 };
71 74
72 } // namespace blink 75 } // namespace blink
73 76
74 #endif // CanvasGradient_h 77 #endif // CanvasGradient_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698