OLD | NEW |
---|---|
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 CanvasSurfaceLayerBridge_h | 5 #ifndef CanvasSurfaceLayerBridge_h |
6 #define CanvasSurfaceLayerBridge_h | 6 #define CanvasSurfaceLayerBridge_h |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "cc/surfaces/surface_id.h" | |
9 #include "platform/PlatformExport.h" | 10 #include "platform/PlatformExport.h" |
11 #include "public/platform/modules/offscreencanvas/offscreen_canvas_surface_servi ce.mojom-blink.h" | |
10 #include "wtf/OwnPtr.h" | 12 #include "wtf/OwnPtr.h" |
11 | 13 |
12 namespace cc { | 14 namespace cc { |
13 // TODO(611796): replace SolidColorLayer with SurfaceLayer | 15 class SurfaceLayer; |
14 class SolidColorLayer; | 16 struct SurfaceSequence; |
15 } | 17 } // namespace cc |
16 | 18 |
17 namespace blink { | 19 namespace blink { |
18 | 20 |
19 class WebLayer; | 21 class WebLayer; |
20 | 22 |
21 class PLATFORM_EXPORT CanvasSurfaceLayerBridge { | 23 class PLATFORM_EXPORT CanvasSurfaceLayerBridge { |
22 public: | 24 public: |
23 explicit CanvasSurfaceLayerBridge(); | 25 explicit CanvasSurfaceLayerBridge(); |
24 ~CanvasSurfaceLayerBridge(); | 26 virtual ~CanvasSurfaceLayerBridge(); |
27 bool createSurfaceLayer(int canvasWidth, int canvasHeight); | |
25 WebLayer* getWebLayer() const { return m_webLayer.get(); } | 28 WebLayer* getWebLayer() const { return m_webLayer.get(); } |
26 | 29 |
30 void satisfyCallback(cc::SurfaceSequence); | |
31 void requireCallback(cc::SurfaceId, cc::SurfaceSequence); | |
32 | |
33 protected: | |
34 // Virtual functions for unit tests | |
danakj
2016/06/13 20:53:39
nit: end comments with punctuation
A common strat
xlai (Olivia)
2016/06/14 21:10:18
Done. Removed all the virtual testing things from
| |
35 virtual bool syncGetServiceId(); | |
36 virtual void asyncRequestSurfaceCreation(); | |
37 cc::SurfaceId m_surfaceId; | |
danakj
2016/06/13 20:53:39
This could be private if you made syncGetServiceId
danakj
2016/06/13 20:53:39
use whitespace to make this separate from the comm
xlai (Olivia)
2016/06/14 21:10:17
Done.
| |
38 | |
27 private: | 39 private: |
28 scoped_refptr<cc::SolidColorLayer> m_solidColorLayer; | 40 scoped_refptr<cc::SurfaceLayer> m_surfaceLayer; |
29 OwnPtr<WebLayer> m_webLayer; | 41 OwnPtr<WebLayer> m_webLayer; |
42 | |
43 mojom::blink::OffscreenCanvasSurfaceServicePtr m_service; | |
30 }; | 44 }; |
31 | 45 |
32 } | 46 } // namespace blink |
33 | 47 |
34 #endif // CanvasSurfaceLayerBridge | 48 #endif // CanvasSurfaceLayerBridge |
danakj
2016/06/13 20:53:39
_h ?
xlai (Olivia)
2016/06/14 21:10:17
Done.
| |
OLD | NEW |