Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/canvas/CanvasImageElementSource.h |
| diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasImageElementSource.h b/third_party/WebKit/Source/core/html/canvas/CanvasImageElementSource.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a82d01220b48cf0f82ff6c6cfb663ed3f0f5d2d6 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/html/canvas/CanvasImageElementSource.h |
| @@ -0,0 +1,52 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CanvasImageElementSource_h |
| +#define CanvasImageElementSource_h |
| + |
| +#include "core/CoreExport.h" |
| +#include "core/html/canvas/CanvasImageSource.h" |
| + |
| +namespace blink { |
| + |
| +class Element; |
| +class ImageLoader; |
| +class ImageResourceContent; |
| + |
| +class CORE_EXPORT CanvasImageElementSource : public CanvasImageSource { |
| + public: |
| + virtual ImageLoader& imageLoader() const = 0; |
| + virtual FloatSize sourceDefaultSize() = 0; |
|
fs
2017/03/07 22:01:25
Should probably be sourceDefaultObjectSize for ext
fserb
2017/03/21 19:15:22
done
|
| + |
| + PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, |
| + AccelerationHint, |
| + SnapshotReason, |
| + const FloatSize&) const override; |
| + |
| + bool wouldTaintOrigin( |
| + SecurityOrigin* destinationSecurityOrigin) const override; |
| + |
| + FloatSize elementSize(const FloatSize& defaultObjectSize) const override; |
| + FloatSize defaultDestinationSize( |
| + const FloatSize& defaultObjectSize) const override; |
| + |
| + bool isAccelerated() const override; |
| + |
| + int sourceWidth() override; |
| + int sourceHeight() override; |
| + |
| + bool isSVGSource() const override; |
| + |
| + bool isOpaque() const override; |
| + |
| + const KURL& sourceURL() const override; |
| + |
| + private: |
| + ImageResourceContent* cachedImage() const; |
| + const Element* element() const; |
|
fs
2017/03/07 22:01:25
Nit: Could be an Element& even
fserb
2017/03/21 19:15:22
done.
|
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // CanvasImageElementSource_h |