1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CC_TEST_FAKE_PROXY_H_
6 #define CC_TEST_FAKE_PROXY_H_
8 #include "cc/base/thread.h"
9 #include "cc/trees/layer_tree_host.h"
10 #include "cc/trees/proxy.h"
14 class FakeProxy
: public Proxy
{
16 explicit FakeProxy(scoped_ptr
<Thread
> impl_thread
)
17 : Proxy(impl_thread
.Pass()) {}
19 virtual bool CompositeAndReadback(void* pixels
, gfx::Rect rect
) OVERRIDE
;
20 virtual void FinishAllRendering() OVERRIDE
{}
21 virtual bool IsStarted() const OVERRIDE
;
22 virtual bool InitializeOutputSurface() OVERRIDE
;
23 virtual void SetSurfaceReady() OVERRIDE
{}
24 virtual void SetVisible(bool visible
) OVERRIDE
{}
25 virtual bool InitializeRenderer() OVERRIDE
;
26 virtual bool RecreateOutputSurface() OVERRIDE
;
27 virtual const RendererCapabilities
& GetRendererCapabilities() const OVERRIDE
;
28 virtual void SetNeedsAnimate() OVERRIDE
{}
29 virtual void SetNeedsCommit() OVERRIDE
{}
30 virtual void SetNeedsRedraw(const gfx::Rect
& damage_rect
) OVERRIDE
{}
31 virtual void SetDeferCommits(bool defer_commits
) OVERRIDE
{}
32 virtual void MainThreadHasStoppedFlinging() OVERRIDE
{}
33 virtual bool CommitRequested() const OVERRIDE
;
34 virtual void Start() OVERRIDE
{}
35 virtual void Stop() OVERRIDE
{}
36 virtual void ForceSerializeOnSwapBuffers() OVERRIDE
{}
37 virtual size_t MaxPartialTextureUpdates() const OVERRIDE
;
38 virtual void AcquireLayerTextures() OVERRIDE
{}
39 virtual bool CommitPendingForTesting() OVERRIDE
;
40 virtual skia::RefPtr
<SkPicture
> CapturePicture() OVERRIDE
;
41 virtual scoped_ptr
<base::Value
> AsValue() const OVERRIDE
;
43 virtual RendererCapabilities
& GetRendererCapabilities();
44 void SetMaxPartialTextureUpdates(size_t max
);
47 RendererCapabilities capabilities_
;
48 size_t max_partial_texture_updates_
;
53 #endif // CC_TEST_FAKE_PROXY_H_