| 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 GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_DELEGATE_H_ | 5 #ifndef GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_DELEGATE_H_ |
| 6 #define GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_DELEGATE_H_ | 6 #define GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "gpu/command_buffer/common/constants.h" | 8 #include "gpu/command_buffer/common/constants.h" |
| 9 #include "gpu/ipc/common/surface_handle.h" | 9 #include "gpu/ipc/common/surface_handle.h" |
| 10 | 10 |
| 11 #if defined(OS_MACOSX) | 11 #if defined(OS_MACOSX) |
| 12 #include "ui/base/cocoa/remote_layer_api.h" | 12 #include "ui/base/cocoa/remote_layer_api.h" |
| 13 #include "ui/gfx/mac/io_surface.h" | 13 #include "ui/gfx/mac/io_surface.h" |
| 14 #include "ui/latency_info/latency_info.h" | 14 #include "ui/latency_info/latency_info.h" |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 class GURL; | 17 class GURL; |
| 18 | 18 |
| 19 namespace IPC { | 19 namespace IPC { |
| 20 struct ChannelHandle; | 20 struct ChannelHandle; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace gpu { | 23 namespace gpu { |
| 24 | 24 |
| 25 struct GPUMemoryUmaStats; | 25 struct GPUMemoryUmaStats; |
| 26 | 26 |
| 27 class GpuChannelManagerDelegate { | 27 class GpuChannelManagerDelegate { |
| 28 public: | 28 public: |
| 29 // Tells the delegate that a context has subscribed to a new target and | |
| 30 // the browser should start sending the corresponding information | |
| 31 virtual void AddSubscription(int32_t client_id, unsigned int target) = 0; | |
| 32 | |
| 33 // Tells the delegate that an offscreen context was created for the provided | 29 // Tells the delegate that an offscreen context was created for the provided |
| 34 // |active_url|. | 30 // |active_url|. |
| 35 virtual void DidCreateOffscreenContext(const GURL& active_url) = 0; | 31 virtual void DidCreateOffscreenContext(const GURL& active_url) = 0; |
| 36 | 32 |
| 37 // Notification from GPU that the channel is destroyed. | 33 // Notification from GPU that the channel is destroyed. |
| 38 virtual void DidDestroyChannel(int client_id) = 0; | 34 virtual void DidDestroyChannel(int client_id) = 0; |
| 39 | 35 |
| 40 // Tells the delegate that an offscreen context was destroyed for the provided | 36 // Tells the delegate that an offscreen context was destroyed for the provided |
| 41 // |active_url|. | 37 // |active_url|. |
| 42 virtual void DidDestroyOffscreenContext(const GURL& active_url) = 0; | 38 virtual void DidDestroyOffscreenContext(const GURL& active_url) = 0; |
| 43 | 39 |
| 44 // Tells the delegate that a context was lost. | 40 // Tells the delegate that a context was lost. |
| 45 virtual void DidLoseContext(bool offscreen, | 41 virtual void DidLoseContext(bool offscreen, |
| 46 error::ContextLostReason reason, | 42 error::ContextLostReason reason, |
| 47 const GURL& active_url) = 0; | 43 const GURL& active_url) = 0; |
| 48 | 44 |
| 49 // Tells the delegate about GPU memory usage statistics for UMA logging. | 45 // Tells the delegate about GPU memory usage statistics for UMA logging. |
| 50 virtual void GpuMemoryUmaStats(const GPUMemoryUmaStats& params) = 0; | 46 virtual void GpuMemoryUmaStats(const GPUMemoryUmaStats& params) = 0; |
| 51 | 47 |
| 52 // Tells the delegate that no contexts are subscribed to the target anymore | |
| 53 // so the delegate should stop sending the corresponding information. | |
| 54 virtual void RemoveSubscription(int32_t client_id, unsigned int target) = 0; | |
| 55 | |
| 56 // Tells the delegate to cache the given shader information in persistent | 48 // Tells the delegate to cache the given shader information in persistent |
| 57 // storage. The embedder is expected to repopulate the in-memory cache through | 49 // storage. The embedder is expected to repopulate the in-memory cache through |
| 58 // the respective GpuChannelManager API. | 50 // the respective GpuChannelManager API. |
| 59 virtual void StoreShaderToDisk(int32_t client_id, | 51 virtual void StoreShaderToDisk(int32_t client_id, |
| 60 const std::string& key, | 52 const std::string& key, |
| 61 const std::string& shader) = 0; | 53 const std::string& shader) = 0; |
| 62 | 54 |
| 63 #if defined(OS_MACOSX) | 55 #if defined(OS_MACOSX) |
| 64 // Tells the delegate that an accelerated surface has swapped. | 56 // Tells the delegate that an accelerated surface has swapped. |
| 65 virtual void SendAcceleratedSurfaceBuffersSwapped( | 57 virtual void SendAcceleratedSurfaceBuffersSwapped( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 80 // Sets the currently active URL. Use GURL() to clear the URL. | 72 // Sets the currently active URL. Use GURL() to clear the URL. |
| 81 virtual void SetActiveURL(const GURL& url) = 0; | 73 virtual void SetActiveURL(const GURL& url) = 0; |
| 82 | 74 |
| 83 protected: | 75 protected: |
| 84 virtual ~GpuChannelManagerDelegate() {} | 76 virtual ~GpuChannelManagerDelegate() {} |
| 85 }; | 77 }; |
| 86 | 78 |
| 87 } // namespace gpu | 79 } // namespace gpu |
| 88 | 80 |
| 89 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_DELEGATE_H_ | 81 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_DELEGATE_H_ |
| OLD | NEW |