| 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 OffscreenCanvasFrameDispatcherImpl_h | 5 #ifndef OffscreenCanvasFrameDispatcherImpl_h |
| 6 #define OffscreenCanvasFrameDispatcherImpl_h | 6 #define OffscreenCanvasFrameDispatcherImpl_h |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include "cc/ipc/mojo_compositor_frame_sink.mojom-blink.h" | 9 #include "cc/ipc/mojo_compositor_frame_sink.mojom-blink.h" |
| 9 #include "cc/output/begin_frame_args.h" | 10 #include "cc/output/begin_frame_args.h" |
| 10 #include "cc/resources/shared_bitmap.h" | 11 #include "cc/resources/shared_bitmap.h" |
| 12 #include "cc/surfaces/local_surface_id_allocator.h" |
| 11 #include "cc/surfaces/surface_id.h" | 13 #include "cc/surfaces/surface_id.h" |
| 12 #include "cc/surfaces/surface_id_allocator.h" | |
| 13 #include "mojo/public/cpp/bindings/binding.h" | 14 #include "mojo/public/cpp/bindings/binding.h" |
| 14 #include "platform/graphics/OffscreenCanvasFrameDispatcher.h" | 15 #include "platform/graphics/OffscreenCanvasFrameDispatcher.h" |
| 15 #include "platform/graphics/StaticBitmapImage.h" | 16 #include "platform/graphics/StaticBitmapImage.h" |
| 16 #include "wtf/Compiler.h" | 17 #include "wtf/Compiler.h" |
| 17 #include <memory> | |
| 18 | 18 |
| 19 namespace blink { | 19 namespace blink { |
| 20 | 20 |
| 21 class PLATFORM_EXPORT OffscreenCanvasFrameDispatcherImpl final | 21 class PLATFORM_EXPORT OffscreenCanvasFrameDispatcherImpl final |
| 22 : public OffscreenCanvasFrameDispatcher, | 22 : public OffscreenCanvasFrameDispatcher, |
| 23 NON_EXPORTED_BASE( | 23 NON_EXPORTED_BASE( |
| 24 public cc::mojom::blink::MojoCompositorFrameSinkClient) { | 24 public cc::mojom::blink::MojoCompositorFrameSinkClient) { |
| 25 public: | 25 public: |
| 26 OffscreenCanvasFrameDispatcherImpl(OffscreenCanvasFrameDispatcherClient*, | 26 OffscreenCanvasFrameDispatcherImpl(OffscreenCanvasFrameDispatcherClient*, |
| 27 uint32_t clientId, | 27 uint32_t clientId, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 50 enum OffscreenCanvasCommitType { | 50 enum OffscreenCanvasCommitType { |
| 51 CommitGPUCanvasGPUCompositing = 0, | 51 CommitGPUCanvasGPUCompositing = 0, |
| 52 CommitGPUCanvasSoftwareCompositing = 1, | 52 CommitGPUCanvasSoftwareCompositing = 1, |
| 53 CommitSoftwareCanvasGPUCompositing = 2, | 53 CommitSoftwareCanvasGPUCompositing = 2, |
| 54 CommitSoftwareCanvasSoftwareCompositing = 3, | 54 CommitSoftwareCanvasSoftwareCompositing = 3, |
| 55 OffscreenCanvasCommitTypeCount, | 55 OffscreenCanvasCommitTypeCount, |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 // Surface-related | 59 // Surface-related |
| 60 cc::SurfaceIdAllocator m_surfaceIdAllocator; | 60 cc::LocalSurfaceIdAllocator m_localSurfaceIdAllocator; |
| 61 const cc::FrameSinkId m_frameSinkId; | 61 const cc::FrameSinkId m_frameSinkId; |
| 62 cc::LocalSurfaceId m_currentLocalSurfaceId; | 62 cc::LocalSurfaceId m_currentLocalSurfaceId; |
| 63 | 63 |
| 64 int m_width; | 64 int m_width; |
| 65 int m_height; | 65 int m_height; |
| 66 bool m_changeSizeForNextCommit; | 66 bool m_changeSizeForNextCommit; |
| 67 bool m_needsBeginFrame; | 67 bool m_needsBeginFrame; |
| 68 | 68 |
| 69 unsigned m_nextResourceId; | 69 unsigned m_nextResourceId; |
| 70 HashMap<unsigned, RefPtr<StaticBitmapImage>> m_cachedImages; | 70 HashMap<unsigned, RefPtr<StaticBitmapImage>> m_cachedImages; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 84 RefPtr<StaticBitmapImage>); | 84 RefPtr<StaticBitmapImage>); |
| 85 void setTransferableResourceToSharedGPUContext(cc::TransferableResource&, | 85 void setTransferableResourceToSharedGPUContext(cc::TransferableResource&, |
| 86 RefPtr<StaticBitmapImage>); | 86 RefPtr<StaticBitmapImage>); |
| 87 void setTransferableResourceToStaticBitmapImage(cc::TransferableResource&, | 87 void setTransferableResourceToStaticBitmapImage(cc::TransferableResource&, |
| 88 RefPtr<StaticBitmapImage>); | 88 RefPtr<StaticBitmapImage>); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace blink | 91 } // namespace blink |
| 92 | 92 |
| 93 #endif // OffscreenCanvasFrameDispatcherImpl_h | 93 #endif // OffscreenCanvasFrameDispatcherImpl_h |
| OLD | NEW |