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

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

Issue 2362363002: Cancel GPU acceleration for 2D canvas when drawing very large images (Closed)
Patch Set: fix sqrt Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/ImageBitmap.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 PassRefPtr<Uint8Array> copyBitmapData(AlphaDisposition = DontPremultiplyAlph a, DataColorFormat = RGBAColorType); 61 PassRefPtr<Uint8Array> copyBitmapData(AlphaDisposition = DontPremultiplyAlph a, DataColorFormat = RGBAColorType);
62 unsigned long width() const; 62 unsigned long width() const;
63 unsigned long height() const; 63 unsigned long height() const;
64 IntSize size() const; 64 IntSize size() const;
65 65
66 bool isNeutered() const { return m_isNeutered; } 66 bool isNeutered() const { return m_isNeutered; }
67 bool originClean() const { return m_image->originClean(); } 67 bool originClean() const { return m_image->originClean(); }
68 bool isPremultiplied() const { return m_image->isPremultiplied(); } 68 bool isPremultiplied() const { return m_image->isPremultiplied(); }
69 PassRefPtr<StaticBitmapImage> transfer(); 69 PassRefPtr<StaticBitmapImage> transfer();
70 void close(); 70 void close();
71 bool isTextureBacked() const;
72 71
73 ~ImageBitmap() override; 72 ~ImageBitmap() override;
74 73
75 // CanvasImageSource implementation 74 // CanvasImageSource implementation
76 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, AccelerationHi nt, SnapshotReason, const FloatSize&) const override; 75 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, AccelerationHi nt, SnapshotReason, const FloatSize&) const override;
77 bool wouldTaintOrigin(SecurityOrigin*) const override { return !m_image->ori ginClean(); } 76 bool wouldTaintOrigin(SecurityOrigin*) const override { return !m_image->ori ginClean(); }
78 void adjustDrawRects(FloatRect* srcRect, FloatRect* dstRect) const override; 77 void adjustDrawRects(FloatRect* srcRect, FloatRect* dstRect) const override;
79 FloatSize elementSize(const FloatSize&) const override; 78 FloatSize elementSize(const FloatSize&) const override;
80 bool isImageBitmap() const override { return true; } 79 bool isImageBitmap() const override { return true; }
81 int sourceWidth() override { return m_image ? m_image->width() : 0; } 80 int sourceWidth() override { return m_image ? m_image->width() : 0; }
82 int sourceHeight() override { return m_image ? m_image->height() : 0; } 81 int sourceHeight() override { return m_image ? m_image->height() : 0; }
82 bool isAccelerated() const override;
83 83
84 // ImageBitmapSource implementation 84 // ImageBitmapSource implementation
85 IntSize bitmapSourceSize() const override { return size(); } 85 IntSize bitmapSourceSize() const override { return size(); }
86 ScriptPromise createImageBitmap(ScriptState*, EventTarget&, Optional<IntRect >, const ImageBitmapOptions&, ExceptionState&) override; 86 ScriptPromise createImageBitmap(ScriptState*, EventTarget&, Optional<IntRect >, const ImageBitmapOptions&, ExceptionState&) override;
87 87
88 DECLARE_VIRTUAL_TRACE(); 88 DECLARE_VIRTUAL_TRACE();
89 89
90 private: 90 private:
91 ImageBitmap(HTMLImageElement*, Optional<IntRect>, Document*, const ImageBitm apOptions&); 91 ImageBitmap(HTMLImageElement*, Optional<IntRect>, Document*, const ImageBitm apOptions&);
92 ImageBitmap(HTMLVideoElement*, Optional<IntRect>, Document*, const ImageBitm apOptions&); 92 ImageBitmap(HTMLVideoElement*, Optional<IntRect>, Document*, const ImageBitm apOptions&);
93 ImageBitmap(HTMLCanvasElement*, Optional<IntRect>, const ImageBitmapOptions& ); 93 ImageBitmap(HTMLCanvasElement*, Optional<IntRect>, const ImageBitmapOptions& );
94 ImageBitmap(ImageData*, Optional<IntRect>, const ImageBitmapOptions&); 94 ImageBitmap(ImageData*, Optional<IntRect>, const ImageBitmapOptions&);
95 ImageBitmap(ImageBitmap*, Optional<IntRect>, const ImageBitmapOptions&); 95 ImageBitmap(ImageBitmap*, Optional<IntRect>, const ImageBitmapOptions&);
96 ImageBitmap(PassRefPtr<StaticBitmapImage>); 96 ImageBitmap(PassRefPtr<StaticBitmapImage>);
97 ImageBitmap(PassRefPtr<StaticBitmapImage>, Optional<IntRect>, const ImageBit mapOptions&); 97 ImageBitmap(PassRefPtr<StaticBitmapImage>, Optional<IntRect>, const ImageBit mapOptions&);
98 ImageBitmap(const void* pixelData, uint32_t width, uint32_t height, bool isI mageBitmapPremultiplied, bool isImageBitmapOriginClean); 98 ImageBitmap(const void* pixelData, uint32_t width, uint32_t height, bool isI mageBitmapPremultiplied, bool isImageBitmapOriginClean);
99 99
100 RefPtr<StaticBitmapImage> m_image; 100 RefPtr<StaticBitmapImage> m_image;
101 bool m_isNeutered = false; 101 bool m_isNeutered = false;
102 }; 102 };
103 103
104 } // namespace blink 104 } // namespace blink
105 105
106 #endif // ImageBitmap_h 106 #endif // ImageBitmap_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/ImageBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698