Index: webkit/common/gpu/context_provider_in_process.h |
diff --git a/webkit/common/gpu/context_provider_in_process.h b/webkit/common/gpu/context_provider_in_process.h |
index 169a1a8fdd3e6eab49eba6257e7c02199bd4904b..7953b304a9f6cabffc95b4bfcbb1a0e78f410e4d 100644 |
--- a/webkit/common/gpu/context_provider_in_process.h |
+++ b/webkit/common/gpu/context_provider_in_process.h |
@@ -10,16 +10,17 @@ |
#include "base/synchronization/lock.h" |
#include "base/threading/thread_checker.h" |
#include "cc/output/context_provider.h" |
+#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" |
#include "webkit/common/gpu/webkit_gpu_export.h" |
namespace WebKit { |
class WebGraphicsContext3D; |
+struct WebGraphicsMemoryAllocation; |
} |
namespace webkit { |
namespace gpu { |
class GrContextForWebGraphicsContext3D; |
-class WebGraphicsContext3DInProcessCommandBufferImpl; |
class WEBKIT_GPU_EXPORT ContextProviderInProcess |
: NON_EXPORTED_BASE(public cc::ContextProvider) { |
@@ -36,12 +37,19 @@ class WEBKIT_GPU_EXPORT ContextProviderInProcess |
static scoped_refptr<ContextProviderInProcess> CreateOffscreen(); |
virtual bool BindToCurrentThread() OVERRIDE; |
- virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; |
+ virtual webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl* |
+ Context3d() OVERRIDE; |
virtual class GrContext* GrContext() OVERRIDE; |
virtual void VerifyContexts() OVERRIDE; |
virtual bool DestroyedOnMainThread() OVERRIDE; |
virtual void SetLostContextCallback( |
const LostContextCallback& lost_context_callback) OVERRIDE; |
+ virtual void SetSwapBuffersCompleteCallback( |
+ const SwapBuffersCompleteCallback& swap_buffers_complete_callback) |
+ OVERRIDE; |
+ virtual void SetMemoryPolicyChangedCallback( |
+ const MemoryPolicyChangedCallback& memory_policy_changed_callback) |
+ OVERRIDE; |
protected: |
ContextProviderInProcess(); |
@@ -51,16 +59,21 @@ class WEBKIT_GPU_EXPORT ContextProviderInProcess |
const CreateCallback& create_callback); |
void OnLostContext(); |
- void OnMemoryAllocationChanged(bool nonzero_allocation); |
+ void OnSwapBuffersComplete(); |
+ void OnMemoryAllocationChanged( |
+ const WebKit::WebGraphicsMemoryAllocation& allocation); |
private: |
base::ThreadChecker main_thread_checker_; |
base::ThreadChecker context_thread_checker_; |
- scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; |
+ scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl> |
+ context3d_; |
scoped_ptr<webkit::gpu::GrContextForWebGraphicsContext3D> gr_context_; |
LostContextCallback lost_context_callback_; |
+ SwapBuffersCompleteCallback swap_buffers_complete_callback_; |
+ MemoryPolicyChangedCallback memory_policy_changed_callback_; |
base::Lock destroyed_lock_; |
bool destroyed_; |
@@ -68,6 +81,10 @@ class WEBKIT_GPU_EXPORT ContextProviderInProcess |
class LostContextCallbackProxy; |
scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; |
+ class SwapBuffersCompleteCallbackProxy; |
+ scoped_ptr<SwapBuffersCompleteCallbackProxy> |
+ swap_buffers_complete_callback_proxy_; |
+ |
class MemoryAllocationCallbackProxy; |
scoped_ptr<MemoryAllocationCallbackProxy> memory_allocation_callback_proxy_; |
}; |