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

Side by Side Diff: third_party/WebKit/Source/core/frame/ImageBitmap.h

Issue 1962413002: Implement transferToImageBitmap() in WebGLRenderingContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add new test case, cache SkIMage Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ImageBitmap_h 5 #ifndef ImageBitmap_h
6 #define ImageBitmap_h 6 #define ImageBitmap_h
7 7
8 #include "bindings/core/v8/ScriptWrappable.h" 8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/CoreExport.h" 9 #include "core/CoreExport.h"
10 #include "core/html/HTMLImageElement.h" 10 #include "core/html/HTMLImageElement.h"
(...skipping 22 matching lines...) Expand all
33 class CORE_EXPORT ImageBitmap final : public GarbageCollectedFinalized<ImageBitm ap>, public ScriptWrappable, public CanvasImageSource, public ImageBitmapSource { 33 class CORE_EXPORT ImageBitmap final : public GarbageCollectedFinalized<ImageBitm ap>, public ScriptWrappable, public CanvasImageSource, public ImageBitmapSource {
34 DEFINE_WRAPPERTYPEINFO(); 34 DEFINE_WRAPPERTYPEINFO();
35 public: 35 public:
36 static ImageBitmap* create(HTMLImageElement*, const IntRect&, Document*, con st ImageBitmapOptions& = ImageBitmapOptions()); 36 static ImageBitmap* create(HTMLImageElement*, const IntRect&, Document*, con st ImageBitmapOptions& = ImageBitmapOptions());
37 static ImageBitmap* create(HTMLVideoElement*, const IntRect&, Document*, con st ImageBitmapOptions& = ImageBitmapOptions()); 37 static ImageBitmap* create(HTMLVideoElement*, const IntRect&, Document*, con st ImageBitmapOptions& = ImageBitmapOptions());
38 static ImageBitmap* create(HTMLCanvasElement*, const IntRect&, const ImageBi tmapOptions& = ImageBitmapOptions()); 38 static ImageBitmap* create(HTMLCanvasElement*, const IntRect&, const ImageBi tmapOptions& = ImageBitmapOptions());
39 static ImageBitmap* create(ImageData*, const IntRect&, const ImageBitmapOpti ons& = ImageBitmapOptions(), const bool& isImageDataPremultiplied = false); 39 static ImageBitmap* create(ImageData*, const IntRect&, const ImageBitmapOpti ons& = ImageBitmapOptions(), const bool& isImageDataPremultiplied = false);
40 static ImageBitmap* create(ImageBitmap*, const IntRect&, const ImageBitmapOp tions& = ImageBitmapOptions()); 40 static ImageBitmap* create(ImageBitmap*, const IntRect&, const ImageBitmapOp tions& = ImageBitmapOptions());
41 static ImageBitmap* create(PassRefPtr<StaticBitmapImage>); 41 static ImageBitmap* create(PassRefPtr<StaticBitmapImage>);
42 static ImageBitmap* create(PassRefPtr<StaticBitmapImage>, const IntRect&, co nst ImageBitmapOptions& = ImageBitmapOptions()); 42 static ImageBitmap* create(PassRefPtr<StaticBitmapImage>, const IntRect&, co nst ImageBitmapOptions& = ImageBitmapOptions());
43 static ImageBitmap* create(WebExternalTextureMailbox&);
43 static PassRefPtr<SkImage> getSkImageFromDecoder(PassOwnPtr<ImageDecoder>); 44 static PassRefPtr<SkImage> getSkImageFromDecoder(PassOwnPtr<ImageDecoder>);
44 45
45 // Type and helper function required by CallbackPromiseAdapter: 46 // Type and helper function required by CallbackPromiseAdapter:
46 using WebType = sk_sp<SkImage>; 47 using WebType = sk_sp<SkImage>;
47 static ImageBitmap* take(ScriptPromiseResolver*, sk_sp<SkImage>); 48 static ImageBitmap* take(ScriptPromiseResolver*, sk_sp<SkImage>);
48 49
49 StaticBitmapImage* bitmapImage() const { return (m_image) ? m_image.get() : nullptr; } 50 StaticBitmapImage* bitmapImage() const { return (m_image) ? m_image.get() : nullptr; }
50 PassOwnPtr<uint8_t[]> copyBitmapData(AlphaDisposition alphaOp = DontPremulti plyAlpha); 51 PassOwnPtr<uint8_t[]> copyBitmapData(AlphaDisposition alphaOp = DontPremulti plyAlpha);
51 unsigned long width() const; 52 unsigned long width() const;
52 unsigned long height() const; 53 unsigned long height() const;
(...skipping 21 matching lines...) Expand all
74 DECLARE_VIRTUAL_TRACE(); 75 DECLARE_VIRTUAL_TRACE();
75 76
76 private: 77 private:
77 ImageBitmap(HTMLImageElement*, const IntRect&, Document*, const ImageBitmapO ptions&); 78 ImageBitmap(HTMLImageElement*, const IntRect&, Document*, const ImageBitmapO ptions&);
78 ImageBitmap(HTMLVideoElement*, const IntRect&, Document*, const ImageBitmapO ptions&); 79 ImageBitmap(HTMLVideoElement*, const IntRect&, Document*, const ImageBitmapO ptions&);
79 ImageBitmap(HTMLCanvasElement*, const IntRect&, const ImageBitmapOptions&); 80 ImageBitmap(HTMLCanvasElement*, const IntRect&, const ImageBitmapOptions&);
80 ImageBitmap(ImageData*, const IntRect&, const ImageBitmapOptions&, const boo l&); 81 ImageBitmap(ImageData*, const IntRect&, const ImageBitmapOptions&, const boo l&);
81 ImageBitmap(ImageBitmap*, const IntRect&, const ImageBitmapOptions&); 82 ImageBitmap(ImageBitmap*, const IntRect&, const ImageBitmapOptions&);
82 ImageBitmap(PassRefPtr<StaticBitmapImage>); 83 ImageBitmap(PassRefPtr<StaticBitmapImage>);
83 ImageBitmap(PassRefPtr<StaticBitmapImage>, const IntRect&, const ImageBitmap Options&); 84 ImageBitmap(PassRefPtr<StaticBitmapImage>, const IntRect&, const ImageBitmap Options&);
85 ImageBitmap(WebExternalTextureMailbox&);
84 86
85 void parseOptions(const ImageBitmapOptions&, bool&, bool&); 87 void parseOptions(const ImageBitmapOptions&, bool&, bool&);
86 88
87 RefPtr<StaticBitmapImage> m_image; 89 RefPtr<StaticBitmapImage> m_image;
88 bool m_isNeutered = false; 90 bool m_isNeutered = false;
89 }; 91 };
90 92
91 } // namespace blink 93 } // namespace blink
92 94
93 #endif // ImageBitmap_h 95 #endif // ImageBitmap_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698