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/CSSImageGeneratorValue.h | 56 +++++++++++------------------ 1 file changed, 20 insertions(+), 36 deletions(-) (limited to 'Source/WebCore/css/CSSImageGeneratorValue.h') diff --git a/Source/WebCore/css/CSSImageGeneratorValue.h b/Source/WebCore/css/CSSImageGeneratorValue.h index 0a6a1b6fd..dc57ea453 100644 --- a/Source/WebCore/css/CSSImageGeneratorValue.h +++ b/Source/WebCore/css/CSSImageGeneratorValue.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,11 +23,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef CSSImageGeneratorValue_h -#define CSSImageGeneratorValue_h +#pragma once #include "CSSValue.h" -#include "IntSizeHash.h" +#include "FloatSizeHash.h" #include "Timer.h" #include @@ -38,61 +37,46 @@ class CachedResourceLoader; class GeneratedImage; class Image; class RenderElement; -class StyleResolver; + +struct ResourceLoaderOptions; class CSSImageGeneratorValue : public CSSValue { public: ~CSSImageGeneratorValue(); - void addClient(RenderElement*); - void removeClient(RenderElement*); + void addClient(RenderElement&); + void removeClient(RenderElement&); - PassRefPtr image(RenderElement*, const IntSize&); + RefPtr image(RenderElement&, const FloatSize&); bool isFixedSize() const; - IntSize fixedSize(const RenderElement*); + FloatSize fixedSize(const RenderElement&); bool isPending() const; - bool knownToBeOpaque(const RenderElement*) const; + bool knownToBeOpaque(const RenderElement&) const; - void loadSubimages(CachedResourceLoader*); + void loadSubimages(CachedResourceLoader&, const ResourceLoaderOptions&); protected: CSSImageGeneratorValue(ClassType); - GeneratedImage* cachedImageForSize(IntSize); - void saveCachedImageForSize(IntSize, PassRefPtr); + GeneratedImage* cachedImageForSize(FloatSize); + void saveCachedImageForSize(FloatSize, GeneratedImage&); const HashCountedSet& clients() const { return m_clients; } // Helper functions for Crossfade and Filter. - static CachedImage* cachedImageForCSSValue(CSSValue*, CachedResourceLoader*); - static bool subimageIsPending(CSSValue*); + static CachedImage* cachedImageForCSSValue(CSSValue&, CachedResourceLoader&, const ResourceLoaderOptions&); + static bool subimageIsPending(const CSSValue&); private: - class CachedGeneratedImage { - public: - CachedGeneratedImage(CSSImageGeneratorValue&, IntSize, PassRefPtr); - GeneratedImage* image() { return m_image.get(); } - void puntEvictionTimer() { m_evictionTimer.restart(); } - - private: - void evictionTimerFired(DeferrableOneShotTimer&); + class CachedGeneratedImage; - CSSImageGeneratorValue& m_owner; - IntSize m_size; - RefPtr m_image; - DeferrableOneShotTimer m_evictionTimer; - }; - - friend class CachedGeneratedImage; - void evictCachedGeneratedImage(IntSize); + void evictCachedGeneratedImage(FloatSize); HashCountedSet m_clients; - HashMap> m_images; + HashMap> m_images; }; -CSS_VALUE_TYPE_CASTS(CSSImageGeneratorValue, isImageGeneratorValue()) - } // namespace WebCore -#endif // CSSImageGeneratorValue_h +SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSImageGeneratorValue, isImageGeneratorValue()) -- cgit v1.2.1