diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-10 07:01:59 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-10 07:01:59 +0000 |
commit | d9a54602add9699ec4d5ebd1630c5c0c580ce8e8 (patch) | |
tree | 233319a1797c5e7dde1f080b65f876baf1869501 /cc/test/test_context_support.h | |
parent | 5291380cf9274160c02d805b7425bacbcfb2a4f5 (diff) | |
download | chromium_src-d9a54602add9699ec4d5ebd1630c5c0c580ce8e8.zip chromium_src-d9a54602add9699ec4d5ebd1630c5c0c580ce8e8.tar.gz chromium_src-d9a54602add9699ec4d5ebd1630c5c0c580ce8e8.tar.bz2 |
Pipe SwapBuffers call{,backs} through ContextSupport
This plumbs the SwapBuffers calls and callbacks through the
gpu::ContextSupport interface instead of WGC3D. There are two production
paths for the callbacks - using Echo and using View IPCs. The former is
used everywhere except for single-threaded mac and guest plugin mode.
This implements the Echo path directly in GLES2Implementation and leaves
the implementation of the non-Echo path in WGC3DCommandBufferImpl. We'll
still have to clean that up to avoid having to allocate a WGC3D, but this
at least gets rid of the API dependencies from cc.
R=piman
BUG=181120
Review URL: https://codereview.chromium.org/59233007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239685 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/test_context_support.h')
-rw-r--r-- | cc/test/test_context_support.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/cc/test/test_context_support.h b/cc/test/test_context_support.h index 9455e15..225ab7a 100644 --- a/cc/test/test_context_support.h +++ b/cc/test/test_context_support.h @@ -7,6 +7,7 @@ #include <vector> +#include "base/memory/weak_ptr.h" #include "gpu/command_buffer/client/context_support.h" namespace cc { @@ -24,6 +25,10 @@ class TestContextSupport : public gpu::ContextSupport { virtual void SetSurfaceVisible(bool visible) OVERRIDE; virtual void SendManagedMemoryStats(const gpu::ManagedMemoryStats& stats) OVERRIDE; + virtual void Swap() OVERRIDE; + virtual void PartialSwapBuffers(gfx::Rect sub_buffer) OVERRIDE; + virtual void SetSwapBuffersCompleteCallback( + const base::Closure& callback) OVERRIDE; void CallAllSyncPointCallbacks(); @@ -31,10 +36,30 @@ class TestContextSupport : public gpu::ContextSupport { void SetSurfaceVisibleCallback( const SurfaceVisibleCallback& set_visible_callback); + enum SwapType { + NO_SWAP, + SWAP, + PARTIAL_SWAP + }; + + SwapType last_swap_type() const { return last_swap_type_; } + gfx::Rect last_partial_swap_rect() const { + return last_partial_swap_rect_; + } + private: + void OnSwapBuffersComplete(); + std::vector<base::Closure> sync_point_callbacks_; SurfaceVisibleCallback set_visible_callback_; + base::Closure swap_buffers_complete_callback_; + + SwapType last_swap_type_; + gfx::Rect last_partial_swap_rect_; + + base::WeakPtrFactory<TestContextSupport> weak_ptr_factory_; + DISALLOW_COPY_AND_ASSIGN(TestContextSupport); }; |