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()),
18 layer_tree_host_(NULL
) {}
20 void SetLayerTreeHost(LayerTreeHost
* host
);
22 virtual bool CompositeAndReadback(void* pixels
, gfx::Rect rect
) OVERRIDE
;
23 virtual void FinishAllRendering() OVERRIDE
{}
24 virtual bool IsStarted() const OVERRIDE
;
25 virtual void SetLayerTreeHostClientReady() OVERRIDE
{}
26 virtual void SetVisible(bool visible
) OVERRIDE
{}
27 virtual void CreateAndInitializeOutputSurface() OVERRIDE
;
28 virtual const RendererCapabilities
& GetRendererCapabilities() const OVERRIDE
;
29 virtual void SetNeedsAnimate() OVERRIDE
{}
30 virtual void SetNeedsCommit() OVERRIDE
{}
31 virtual void SetNeedsRedraw(gfx::Rect damage_rect
) OVERRIDE
{}
32 virtual void SetDeferCommits(bool defer_commits
) OVERRIDE
{}
33 virtual void MainThreadHasStoppedFlinging() OVERRIDE
{}
34 virtual bool CommitRequested() const OVERRIDE
;
35 virtual void Start(scoped_ptr
<OutputSurface
> first_output_surface
) OVERRIDE
{}
36 virtual void Stop() OVERRIDE
{}
37 virtual void ForceSerializeOnSwapBuffers() OVERRIDE
{}
38 virtual size_t MaxPartialTextureUpdates() const OVERRIDE
;
39 virtual void AcquireLayerTextures() OVERRIDE
{}
40 virtual bool CommitPendingForTesting() OVERRIDE
;
41 virtual skia::RefPtr
<SkPicture
> CapturePicture() OVERRIDE
;
42 virtual scoped_ptr
<base::Value
> AsValue() const OVERRIDE
;
44 virtual RendererCapabilities
& GetRendererCapabilities();
45 void SetMaxPartialTextureUpdates(size_t max
);
48 RendererCapabilities capabilities_
;
49 size_t max_partial_texture_updates_
;
50 LayerTreeHost
* layer_tree_host_
;
55 #endif // CC_TEST_FAKE_PROXY_H_