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/css/CSSCrossfadeValue.h | 81 ++++++++++++---------------------- 1 file changed, 27 insertions(+), 54 deletions(-) (limited to 'Source/WebCore/css/CSSCrossfadeValue.h') diff --git a/Source/WebCore/css/CSSCrossfadeValue.h b/Source/WebCore/css/CSSCrossfadeValue.h index 53bd05983..a3500b44e 100644 --- a/Source/WebCore/css/CSSCrossfadeValue.h +++ b/Source/WebCore/css/CSSCrossfadeValue.h @@ -10,10 +10,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 @@ -23,95 +23,68 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef CSSCrossfadeValue_h -#define CSSCrossfadeValue_h +#pragma once #include "CachedImageClient.h" #include "CachedResourceHandle.h" #include "CSSImageGeneratorValue.h" -#include "CSSPrimitiveValue.h" -#include "Image.h" -#include "ImageObserver.h" namespace WebCore { -class CachedImage; -class CrossfadeSubimageObserverProxy; -class RenderElement; -class Document; +class CSSPrimitiveValue; -class CSSCrossfadeValue : public CSSImageGeneratorValue { - friend class CrossfadeSubimageObserverProxy; +class CSSCrossfadeValue final : public CSSImageGeneratorValue { public: - static PassRef create(PassRefPtr fromValue, PassRefPtr toValue) - { - return adoptRef(*new CSSCrossfadeValue(fromValue, toValue)); - } + static Ref create(Ref&& fromValue, Ref&& toValue, Ref&& percentageValue, bool prefixed = false); ~CSSCrossfadeValue(); String customCSSText() const; - PassRefPtr image(RenderElement*, const IntSize&); + Image* image(RenderElement&, const FloatSize&); bool isFixedSize() const { return true; } - IntSize fixedSize(const RenderElement*); + FloatSize fixedSize(const RenderElement&); + bool isPrefixed() const { return m_isPrefixed; } bool isPending() const; - bool knownToBeOpaque(const RenderElement*) const; + bool knownToBeOpaque(const RenderElement&) const; - void loadSubimages(CachedResourceLoader*); + void loadSubimages(CachedResourceLoader&, const ResourceLoaderOptions&); - void setPercentage(PassRefPtr percentageValue) { m_percentageValue = percentageValue; } + bool traverseSubresources(const std::function& handler) const; - bool hasFailedOrCanceledSubresources() const; - - PassRefPtr blend(const CSSCrossfadeValue&, double) const; + RefPtr blend(const CSSCrossfadeValue&, double) const; bool equals(const CSSCrossfadeValue&) const; - bool equalInputImages(const CSSCrossfadeValue&) const; private: - CSSCrossfadeValue(PassRefPtr fromValue, PassRefPtr toValue) - : CSSImageGeneratorValue(CrossfadeClass) - , m_fromValue(fromValue) - , m_toValue(toValue) - , m_crossfadeSubimageObserver(this) - { - } - - class CrossfadeSubimageObserverProxy : public CachedImageClient { + CSSCrossfadeValue(Ref&& fromValue, Ref&& toValue, Ref&& percentageValue, bool prefixed); + + class SubimageObserver final : public CachedImageClient { public: - CrossfadeSubimageObserverProxy(CSSCrossfadeValue* ownerValue) - : m_ownerValue(ownerValue) - , m_ready(false) - { - } - - virtual ~CrossfadeSubimageObserverProxy() { } - virtual void imageChanged(CachedImage*, const IntRect* = 0) override; - void setReady(bool ready) { m_ready = ready; } + SubimageObserver(CSSCrossfadeValue&); private: - CSSCrossfadeValue* m_ownerValue; - bool m_ready; + void imageChanged(CachedImage*, const IntRect*) final; + CSSCrossfadeValue& m_owner; }; - void crossfadeChanged(const IntRect&); + void crossfadeChanged(); - RefPtr m_fromValue; - RefPtr m_toValue; - RefPtr m_percentageValue; + Ref m_fromValue; + Ref m_toValue; + Ref m_percentageValue; CachedResourceHandle m_cachedFromImage; CachedResourceHandle m_cachedToImage; RefPtr m_generatedImage; - CrossfadeSubimageObserverProxy m_crossfadeSubimageObserver; + SubimageObserver m_subimageObserver; + bool m_isPrefixed { false }; + bool m_subimagesAreReady { false }; }; -CSS_VALUE_TYPE_CASTS(CSSCrossfadeValue, isCrossfadeValue()) - } // namespace WebCore -#endif // CSSCrossfadeValue_h +SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSCrossfadeValue, isCrossfadeValue()) -- cgit v1.2.1