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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.h

Issue 2328463004: Implement WebGL's commit on the main thread (Closed)
Patch Set: address comments Created 4 years, 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 OffscreenCanvasFrameDispatcherImpl_h 5 #ifndef OffscreenCanvasFrameDispatcherImpl_h
6 #define OffscreenCanvasFrameDispatcherImpl_h 6 #define OffscreenCanvasFrameDispatcherImpl_h
7 7
8 #include "cc/surfaces/surface_id.h" 8 #include "cc/surfaces/surface_id.h"
9 #include "mojo/public/cpp/bindings/binding.h"
9 #include "platform/graphics/OffscreenCanvasFrameDispatcher.h" 10 #include "platform/graphics/OffscreenCanvasFrameDispatcher.h"
11 #include "platform/graphics/StaticBitmapImage.h"
10 #include "public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom -blink.h" 12 #include "public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom -blink.h"
11 #include <memory> 13 #include <memory>
12 14
13 namespace blink { 15 namespace blink {
14 16
15 class PLATFORM_EXPORT OffscreenCanvasFrameDispatcherImpl final : public Offscree nCanvasFrameDispatcher { 17 class PLATFORM_EXPORT OffscreenCanvasFrameDispatcherImpl final : public Offscree nCanvasFrameDispatcher, public mojom::blink::OffscreenCanvasFrameReceiverClient {
16 public: 18 public:
17 explicit OffscreenCanvasFrameDispatcherImpl(uint32_t clientId, uint32_t loca lId, uint64_t nonce, int width, int height); 19 explicit OffscreenCanvasFrameDispatcherImpl(uint32_t clientId, uint32_t loca lId, uint64_t nonce, int width, int height);
18 20
19 // OffscreenCanvasFrameDispatcher implementation. 21 // OffscreenCanvasFrameDispatcher implementation.
20 ~OffscreenCanvasFrameDispatcherImpl() override {} 22 ~OffscreenCanvasFrameDispatcherImpl() override {}
21 void dispatchFrame() override; 23 void dispatchFrame(RefPtr<StaticBitmapImage>) override;
24
25 // OffscreenCanvasFrameReceiverClient implementation.
26 void ReturnResources(Vector<cc::mojom::blink::ReturnedResourcePtr> resources ) override;
xlai (Olivia) 2016/09/14 17:54:46 Hmmm..Is resourceId the only and single item that
22 27
23 private: 28 private:
24 const cc::SurfaceId m_surfaceId; 29 const cc::SurfaceId m_surfaceId;
25 const int m_width; 30 const int m_width;
26 const int m_height; 31 const int m_height;
27 mojom::blink::OffscreenCanvasFrameReceiverPtr m_service; 32 mojom::blink::OffscreenCanvasFrameReceiverPtr m_service;
33
34 HashMap<unsigned, RefPtr<StaticBitmapImage>> m_cachedImages;
35 mojo::Binding<mojom::blink::OffscreenCanvasFrameReceiverClient> m_binding;
28 }; 36 };
29 37
30 } // namespace blink 38 } // namespace blink
31 39
32 #endif // OffscreenCanvasFrameDispatcherImpl_h 40 #endif // OffscreenCanvasFrameDispatcherImpl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698