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

Side by Side Diff: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h

Issue 2508943003: Make OffscreenCanvas resizeable (Closed)
Patch Set: Created 4 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 OffscreenCanvas_h 5 #ifndef OffscreenCanvas_h
6 #define OffscreenCanvas_h 6 #define OffscreenCanvas_h
7 7
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/ScriptWrappable.h" 10 #include "bindings/core/v8/ScriptWrappable.h"
(...skipping 19 matching lines...) Expand all
30 public CanvasImageSource { 30 public CanvasImageSource {
31 DEFINE_WRAPPERTYPEINFO(); 31 DEFINE_WRAPPERTYPEINFO();
32 32
33 public: 33 public:
34 static OffscreenCanvas* create(unsigned width, unsigned height); 34 static OffscreenCanvas* create(unsigned width, unsigned height);
35 ~OffscreenCanvas() override {} 35 ~OffscreenCanvas() override {}
36 36
37 // IDL attributes 37 // IDL attributes
38 unsigned width() const { return m_size.width(); } 38 unsigned width() const { return m_size.width(); }
39 unsigned height() const { return m_size.height(); } 39 unsigned height() const { return m_size.height(); }
40 void setWidth(unsigned, ExceptionState&); 40 void setWidth(unsigned);
41 void setHeight(unsigned, ExceptionState&); 41 void setHeight(unsigned);
42 42
43 // API Methods 43 // API Methods
44 ImageBitmap* transferToImageBitmap(ScriptState*, ExceptionState&); 44 ImageBitmap* transferToImageBitmap(ScriptState*, ExceptionState&);
45 ScriptPromise convertToBlob(ScriptState*, 45 ScriptPromise convertToBlob(ScriptState*,
46 const ImageEncodeOptions&, 46 const ImageEncodeOptions&,
47 ExceptionState&); 47 ExceptionState&);
48 48
49 IntSize size() const { return m_size; } 49 IntSize size() const { return m_size; }
50 void setSize(const IntSize&);
51
50 void setPlaceholderCanvasId(int canvasId) { 52 void setPlaceholderCanvasId(int canvasId) {
51 m_placeholderCanvasId = canvasId; 53 m_placeholderCanvasId = canvasId;
52 } 54 }
53 int placeholderCanvasId() const { return m_placeholderCanvasId; } 55 int placeholderCanvasId() const { return m_placeholderCanvasId; }
54 bool hasPlaceholderCanvas() { 56 bool hasPlaceholderCanvas() {
55 return m_placeholderCanvasId != kNoPlaceholderCanvas; 57 return m_placeholderCanvasId != kNoPlaceholderCanvas;
56 } 58 }
57 bool isNeutered() const { return m_isNeutered; } 59 bool isNeutered() const { return m_isNeutered; }
58 void setNeutered(); 60 void setNeutered();
59 CanvasRenderingContext* getCanvasRenderingContext( 61 CanvasRenderingContext* getCanvasRenderingContext(
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 uint32_t m_clientId = 0; 154 uint32_t m_clientId = 0;
153 uint32_t m_sinkId = 0; 155 uint32_t m_sinkId = 0;
154 uint32_t m_localId = 0; 156 uint32_t m_localId = 0;
155 uint64_t m_nonceHigh = 0; 157 uint64_t m_nonceHigh = 0;
156 uint64_t m_nonceLow = 0; 158 uint64_t m_nonceLow = 0;
157 }; 159 };
158 160
159 } // namespace blink 161 } // namespace blink
160 162
161 #endif // OffscreenCanvas_h 163 #endif // OffscreenCanvas_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698