diff options
author | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-22 03:22:19 +0000 |
---|---|---|
committer | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-22 03:22:19 +0000 |
commit | 41b53ac72fcfe430e816cea48a32bb00e346547f (patch) | |
tree | 0f3f1f082451247693dba41dcb919d270991c96a /cc/test/fake_output_surface_client.h | |
parent | 887dc5d85a487e0a071099b58f1ea2235602a0ab (diff) | |
download | chromium_src-41b53ac72fcfe430e816cea48a32bb00e346547f.zip chromium_src-41b53ac72fcfe430e816cea48a32bb00e346547f.tar.gz chromium_src-41b53ac72fcfe430e816cea48a32bb00e346547f.tar.bz2 |
cc: Allow DeferredInitialize to use DelegatingRenderer
Currently DeferredInitialize assumes OutputSurface never has
delegated_rendering capability. With this change, remove this
assumption by always first creating SoftwareRenderer for
OutputSurface with deferred_gl_initialization. Then create
either DelegatingRenderer or GLRenderer depending on
delegated_rendering capability in DeferredInitialize.
With support for DelegatingRenderer and DeferredInititalize,
have to ensure that all GL resources are returned to child
before ReleasGL is called, because ContextProvider is going
away after ReleaseGL. Add a DCHECK for this in
ResourceProvider::CleanUpGLIfNeeded.
New path covered by LayerTreeHostTestDeferredInitialize.
BUG=344087
Review URL: https://codereview.chromium.org/286953008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272070 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/fake_output_surface_client.h')
-rw-r--r-- | cc/test/fake_output_surface_client.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/cc/test/fake_output_surface_client.h b/cc/test/fake_output_surface_client.h index 0548bde..7058e52 100644 --- a/cc/test/fake_output_surface_client.h +++ b/cc/test/fake_output_surface_client.h @@ -10,16 +10,26 @@ namespace cc { +class OutputSurface; + class FakeOutputSurfaceClient : public OutputSurfaceClient { public: FakeOutputSurfaceClient() - : begin_frame_count_(0), + : output_surface_(NULL), + begin_frame_count_(0), + deferred_initialize_called_(false), + did_lose_output_surface_called_(false), + memory_policy_(0) {} + + explicit FakeOutputSurfaceClient(OutputSurface* output_surface) + : output_surface_(output_surface), + begin_frame_count_(0), deferred_initialize_called_(false), did_lose_output_surface_called_(false), memory_policy_(0) {} virtual void DeferredInitialize() OVERRIDE; - virtual void ReleaseGL() OVERRIDE {} + virtual void ReleaseGL() OVERRIDE; virtual void CommitVSyncParameters(base::TimeTicks timebase, base::TimeDelta interval) OVERRIDE {} virtual void SetNeedsRedrawRect(const gfx::Rect& damage_rect) OVERRIDE {} @@ -49,6 +59,7 @@ class FakeOutputSurfaceClient : public OutputSurfaceClient { const ManagedMemoryPolicy& memory_policy() const { return memory_policy_; } private: + OutputSurface* output_surface_; int begin_frame_count_; bool deferred_initialize_called_; bool did_lose_output_surface_called_; |