| 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 "cc/ipc/mojo_compositor_frame_sink.mojom-blink.h" | 8 #include "cc/ipc/mojo_compositor_frame_sink.mojom-blink.h" |
| 9 #include "cc/resources/shared_bitmap.h" | 9 #include "cc/resources/shared_bitmap.h" |
| 10 #include "cc/surfaces/surface_id.h" | 10 #include "cc/surfaces/surface_id.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 // OffscreenCanvasFrameDispatcher implementation. | 31 // OffscreenCanvasFrameDispatcher implementation. |
| 32 ~OffscreenCanvasFrameDispatcherImpl() override {} | 32 ~OffscreenCanvasFrameDispatcherImpl() override {} |
| 33 void dispatchFrame(RefPtr<StaticBitmapImage>, | 33 void dispatchFrame(RefPtr<StaticBitmapImage>, |
| 34 bool isWebGLSoftwareRendering = false) override; | 34 bool isWebGLSoftwareRendering = false) override; |
| 35 | 35 |
| 36 // cc::mojom::blink::MojoCompositorFrameSinkClient implementation. | 36 // cc::mojom::blink::MojoCompositorFrameSinkClient implementation. |
| 37 void ReturnResources( | 37 void ReturnResources( |
| 38 Vector<cc::mojom::blink::ReturnedResourcePtr> resources) override; | 38 Vector<cc::mojom::blink::ReturnedResourcePtr> resources) override; |
| 39 | 39 |
| 40 // This enum is used in histogram, so it should be append-only. |
| 41 enum OffscreenCanvasCommitType { |
| 42 CommitGPUCanvasGPUCompositing = 0, |
| 43 CommitGPUCanvasSoftwareCompositing = 1, |
| 44 CommitSoftwareCanvasGPUCompositing = 2, |
| 45 CommitSoftwareCanvasSoftwareCompositing = 3, |
| 46 OffscreenCanvasCommitTypeCount, |
| 47 }; |
| 48 |
| 40 private: | 49 private: |
| 41 const cc::SurfaceId m_surfaceId; | 50 const cc::SurfaceId m_surfaceId; |
| 42 const int m_width; | 51 const int m_width; |
| 43 const int m_height; | 52 const int m_height; |
| 44 | 53 |
| 45 unsigned m_nextResourceId; | 54 unsigned m_nextResourceId; |
| 46 HashMap<unsigned, RefPtr<StaticBitmapImage>> m_cachedImages; | 55 HashMap<unsigned, RefPtr<StaticBitmapImage>> m_cachedImages; |
| 47 HashMap<unsigned, std::unique_ptr<cc::SharedBitmap>> m_sharedBitmaps; | 56 HashMap<unsigned, std::unique_ptr<cc::SharedBitmap>> m_sharedBitmaps; |
| 48 HashMap<unsigned, GLuint> m_cachedTextureIds; | 57 HashMap<unsigned, GLuint> m_cachedTextureIds; |
| 49 | 58 |
| 50 bool verifyImageSize(const sk_sp<SkImage>&); | 59 bool verifyImageSize(const sk_sp<SkImage>&); |
| 51 | 60 |
| 52 cc::mojom::blink::MojoCompositorFrameSinkPtr m_sink; | 61 cc::mojom::blink::MojoCompositorFrameSinkPtr m_sink; |
| 53 mojo::Binding<cc::mojom::blink::MojoCompositorFrameSinkClient> m_binding; | 62 mojo::Binding<cc::mojom::blink::MojoCompositorFrameSinkClient> m_binding; |
| 54 | 63 |
| 55 void setTransferableResourceToSharedBitmap(cc::TransferableResource&, | 64 void setTransferableResourceToSharedBitmap(cc::TransferableResource&, |
| 56 RefPtr<StaticBitmapImage>); | 65 RefPtr<StaticBitmapImage>); |
| 57 void setTransferableResourceToSharedGPUContext(cc::TransferableResource&, | 66 void setTransferableResourceToSharedGPUContext(cc::TransferableResource&, |
| 58 RefPtr<StaticBitmapImage>); | 67 RefPtr<StaticBitmapImage>); |
| 59 void setTransferableResourceToStaticBitmapImage(cc::TransferableResource&, | 68 void setTransferableResourceToStaticBitmapImage(cc::TransferableResource&, |
| 60 RefPtr<StaticBitmapImage>); | 69 RefPtr<StaticBitmapImage>); |
| 61 }; | 70 }; |
| 62 | 71 |
| 63 } // namespace blink | 72 } // namespace blink |
| 64 | 73 |
| 65 #endif // OffscreenCanvasFrameDispatcherImpl_h | 74 #endif // OffscreenCanvasFrameDispatcherImpl_h |
| OLD | NEW |