| 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 CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_MANAGER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "cc/surfaces/surface_id.h" | 9 #include "cc/surfaces/surface_id.h" |
| 10 #include "cc/surfaces/surface_observer.h" | 10 #include "cc/surfaces/surface_observer.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 void RegisterOffscreenCanvasSurfaceInstance(cc::FrameSinkId, | 23 void RegisterOffscreenCanvasSurfaceInstance(cc::FrameSinkId, |
| 24 OffscreenCanvasSurfaceImpl*); | 24 OffscreenCanvasSurfaceImpl*); |
| 25 void UnregisterOffscreenCanvasSurfaceInstance(cc::FrameSinkId); | 25 void UnregisterOffscreenCanvasSurfaceInstance(cc::FrameSinkId); |
| 26 OffscreenCanvasSurfaceImpl* GetSurfaceInstance(cc::FrameSinkId); | 26 OffscreenCanvasSurfaceImpl* GetSurfaceInstance(cc::FrameSinkId); |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 friend class OffscreenCanvasSurfaceManagerTest; | 29 friend class OffscreenCanvasSurfaceManagerTest; |
| 30 | 30 |
| 31 // cc::SurfaceObserver implementation. | 31 // cc::SurfaceObserver implementation. |
| 32 // TODO(crbug.com/662498): Implement these functions when | |
| 33 // OffscreenCanvasSurfaceManager must propagate the resizing information | |
| 34 // back to renderer/main. | |
| 35 void OnSurfaceCreated(const cc::SurfaceId& surface_id, | 32 void OnSurfaceCreated(const cc::SurfaceId& surface_id, |
| 36 const gfx::Size& frame_size, | 33 const gfx::Size& frame_size, |
| 37 float device_scale_factor) override {} | 34 float device_scale_factor) override; |
| 38 void OnSurfaceDamaged(const cc::SurfaceId&, bool* changed) override {} | 35 void OnSurfaceDamaged(const cc::SurfaceId&, bool* changed) override {} |
| 39 | 36 |
| 40 // When an OffscreenCanvasSurfaceImpl instance is destructed, it will | 37 // When an OffscreenCanvasSurfaceImpl instance is destructed, it will |
| 41 // unregister the corresponding entry from this map. | 38 // unregister the corresponding entry from this map. |
| 42 std::unordered_map<cc::FrameSinkId, | 39 std::unordered_map<cc::FrameSinkId, |
| 43 OffscreenCanvasSurfaceImpl*, | 40 OffscreenCanvasSurfaceImpl*, |
| 44 cc::FrameSinkIdHash> | 41 cc::FrameSinkIdHash> |
| 45 registered_surface_instances_; | 42 registered_surface_instances_; |
| 46 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasSurfaceManager); | 43 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasSurfaceManager); |
| 47 }; | 44 }; |
| 48 | 45 |
| 49 } // namespace content | 46 } // namespace content |
| 50 | 47 |
| 51 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_MANAGER_H_ | 48 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_MANAGER_H_ |
| OLD | NEW |