From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/html/canvas/CanvasGradient.h | 60 +++++++++++++---------------- 1 file changed, 27 insertions(+), 33 deletions(-) (limited to 'Source/WebCore/html/canvas/CanvasGradient.h') diff --git a/Source/WebCore/html/canvas/CanvasGradient.h b/Source/WebCore/html/canvas/CanvasGradient.h index 8529d584d..bf7501338 100644 --- a/Source/WebCore/html/canvas/CanvasGradient.h +++ b/Source/WebCore/html/canvas/CanvasGradient.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. * Copyright (C) 2007 Alp Toker * * Redistribution and use in source and binary forms, with or without @@ -11,10 +11,10 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR @@ -24,47 +24,41 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef CanvasGradient_h -#define CanvasGradient_h +#pragma once +#include "ExceptionOr.h" #include "Gradient.h" -#include -#include -#include namespace WebCore { - typedef int ExceptionCode; +class CanvasGradient : public RefCounted { +public: + static Ref create(const FloatPoint& p0, const FloatPoint& p1) + { + return adoptRef(*new CanvasGradient(p0, p1)); + } + static Ref create(const FloatPoint& p0, float r0, const FloatPoint& p1, float r1) + { + return adoptRef(*new CanvasGradient(p0, r0, p1, r1)); + } - class CanvasGradient : public RefCounted { - public: - static PassRefPtr create(const FloatPoint& p0, const FloatPoint& p1) - { - return adoptRef(new CanvasGradient(p0, p1)); - } - static PassRefPtr create(const FloatPoint& p0, float r0, const FloatPoint& p1, float r1) - { - return adoptRef(new CanvasGradient(p0, r0, p1, r1)); - } - - Gradient* gradient() const { return m_gradient.get(); } + Gradient& gradient() { return m_gradient; } + const Gradient& gradient() const { return m_gradient; } - void addColorStop(float value, const String& color, ExceptionCode&); + ExceptionOr addColorStop(float value, const String& color); #if ENABLE(DASHBOARD_SUPPORT) - void setDashboardCompatibilityMode() { m_dashbardCompatibilityMode = true; } + void setDashboardCompatibilityMode() { m_dashboardCompatibilityMode = true; } #endif - private: - CanvasGradient(const FloatPoint& p0, const FloatPoint& p1); - CanvasGradient(const FloatPoint& p0, float r0, const FloatPoint& p1, float r1); - - RefPtr m_gradient; +private: + CanvasGradient(const FloatPoint& p0, const FloatPoint& p1); + CanvasGradient(const FloatPoint& p0, float r0, const FloatPoint& p1, float r1); + + Ref m_gradient; #if ENABLE(DASHBOARD_SUPPORT) - bool m_dashbardCompatibilityMode; + bool m_dashboardCompatibilityMode { false }; #endif - }; - -} //namespace +}; -#endif +} -- cgit v1.2.1