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

Unified Diff: third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.h

Issue 2351363002: Make CSSStyleImageValue a member of CanvasImageSource. (Closed)
Patch Set: Override isAccelerated Created 4 years, 3 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/core/css/cssom/CSSStyleImageValue.h
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.h b/third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.h
index ccba062dd12237b76dab1ab9efcc37416cc96390..37f43ceea50f5379616b49aca03a629f7553a43b 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.h
@@ -5,15 +5,19 @@
#ifndef CSSStyleImageValue_h
#define CSSStyleImageValue_h
+#include "core/CoreExport.h"
+#include "core/css/CSSImageValue.h"
#include "core/css/CSSImageValue.h"
#include "core/css/cssom/CSSResourceValue.h"
+#include "core/css/cssom/CSSStyleValue.h"
#include "core/fetch/ImageResource.h"
+#include "core/html/canvas/CanvasImageSource.h"
+#include "core/imagebitmap/ImageBitmapSource.h"
#include "core/style/StyleImage.h"
-
namespace blink {
-class CORE_EXPORT CSSStyleImageValue : public CSSResourceValue {
+class CORE_EXPORT CSSStyleImageValue : public CSSResourceValue, public CanvasImageSource {
WTF_MAKE_NONCOPYABLE(CSSStyleImageValue);
DEFINE_WRAPPERTYPEINFO();
public:
@@ -21,10 +25,25 @@ public:
StyleValueType type() const override { return ImageType; }
- double intrinsicWidth(bool& isNull);
- double intrinsicHeight(bool& isNull);
+ double intrinsicWidth(bool& isNull) const;
+ double intrinsicHeight(bool& isNull) const;
double intrinsicRatio(bool& isNull);
+ // CanvasImageSource
+ bool isCSSImageValue() const final { return true; }
+ int sourceWidth() final;
+ int sourceHeight() final;
+ bool wouldTaintOrigin(SecurityOrigin* destinationSecurityOrigin) const final
+ {
+ return true;
+ }
+ FloatSize elementSize(const FloatSize& defaultObjectSize) const final;
+ PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, AccelerationHint, SnapshotReason, const FloatSize&) const final
+ {
+ return image();
+ }
+ bool isAccelerated() const override;
+
DEFINE_INLINE_VIRTUAL_TRACE()
{
visitor->trace(m_imageValue);
@@ -54,6 +73,9 @@ protected:
return Resource::Status::NotStarted;
return m_imageValue->cachedImage()->cachedImage()->getStatus();
}
+
+private:
+ PassRefPtr<Image> image() const;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698