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/offscreencanvas/OffscreenCanvas.h

Issue 2420203002: Implement convertToBlob() in OffscreenCanvas (Closed)
Patch Set: rename function name 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
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"
11 #include "core/html/HTMLCanvasElement.h" 11 #include "core/html/HTMLCanvasElement.h"
12 #include "core/html/canvas/CanvasImageSource.h" 12 #include "core/html/canvas/CanvasImageSource.h"
13 #include "core/offscreencanvas/ImageEncodeOptions.h"
13 #include "platform/geometry/IntSize.h" 14 #include "platform/geometry/IntSize.h"
14 #include "platform/graphics/OffscreenCanvasFrameDispatcher.h" 15 #include "platform/graphics/OffscreenCanvasFrameDispatcher.h"
15 #include "platform/heap/Handle.h" 16 #include "platform/heap/Handle.h"
16 #include <memory> 17 #include <memory>
17 18
18 namespace blink { 19 namespace blink {
19 20
20 class CanvasContextCreationAttributes; 21 class CanvasContextCreationAttributes;
21 class ImageBitmap; 22 class ImageBitmap;
22 class 23 class
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 CanvasRenderingContext* renderingContext() { return m_context; } 55 CanvasRenderingContext* renderingContext() { return m_context; }
55 56
56 static void registerRenderingContextFactory( 57 static void registerRenderingContextFactory(
57 std::unique_ptr<CanvasRenderingContextFactory>); 58 std::unique_ptr<CanvasRenderingContextFactory>);
58 59
59 bool originClean() const; 60 bool originClean() const;
60 void setOriginTainted() { m_originClean = false; } 61 void setOriginTainted() { m_originClean = false; }
61 // TODO(crbug.com/630356): apply the flag to WebGL context as well 62 // TODO(crbug.com/630356): apply the flag to WebGL context as well
62 void setDisableReadingFromCanvasTrue() { m_disableReadingFromCanvas = true; } 63 void setDisableReadingFromCanvasTrue() { m_disableReadingFromCanvas = true; }
63 64
65 bool isPaintable() const;
66
64 OffscreenCanvasFrameDispatcher* getOrCreateFrameDispatcher(); 67 OffscreenCanvasFrameDispatcher* getOrCreateFrameDispatcher();
65 68
66 void setSurfaceId(uint32_t clientId, 69 void setSurfaceId(uint32_t clientId,
67 uint32_t sinkId, 70 uint32_t sinkId,
68 uint32_t localId, 71 uint32_t localId,
69 uint64_t nonce) { 72 uint64_t nonce) {
70 m_clientId = clientId; 73 m_clientId = clientId;
71 m_sinkId = sinkId; 74 m_sinkId = sinkId;
72 m_localId = localId; 75 m_localId = localId;
73 m_nonce = nonce; 76 m_nonce = nonce;
(...skipping 30 matching lines...) Expand all
104 107
105 Member<CanvasRenderingContext> m_context; 108 Member<CanvasRenderingContext> m_context;
106 int m_canvasId = -1; // DOMNodeIds starts from 0, using -1 to indicate no 109 int m_canvasId = -1; // DOMNodeIds starts from 0, using -1 to indicate no
107 // associated canvas element. 110 // associated canvas element.
108 IntSize m_size; 111 IntSize m_size;
109 bool m_isNeutered = false; 112 bool m_isNeutered = false;
110 113
111 bool m_originClean; 114 bool m_originClean;
112 bool m_disableReadingFromCanvas = false; 115 bool m_disableReadingFromCanvas = false;
113 116
114 bool isPaintable() const;
115
116 std::unique_ptr<OffscreenCanvasFrameDispatcher> m_frameDispatcher; 117 std::unique_ptr<OffscreenCanvasFrameDispatcher> m_frameDispatcher;
117 // cc::SurfaceId is broken into three integer components as this can be used 118 // cc::SurfaceId is broken into three integer components as this can be used
118 // in transfer of OffscreenCanvas across threads 119 // in transfer of OffscreenCanvas across threads
119 // If this object is not created via 120 // If this object is not created via
120 // HTMLCanvasElement.transferControlToOffscreen(), 121 // HTMLCanvasElement.transferControlToOffscreen(),
121 // then the following members would remain as initialized zero values. 122 // then the following members would remain as initialized zero values.
122 uint32_t m_clientId = 0; 123 uint32_t m_clientId = 0;
123 uint32_t m_sinkId = 0; 124 uint32_t m_sinkId = 0;
124 uint32_t m_localId = 0; 125 uint32_t m_localId = 0;
125 uint64_t m_nonce = 0; 126 uint64_t m_nonce = 0;
126 }; 127 };
127 128
128 } // namespace blink 129 } // namespace blink
129 130
130 #endif // OffscreenCanvas_h 131 #endif // OffscreenCanvas_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698