Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(707)

Side by Side Diff: cc/test/fake_proxy.h

Issue 12544032: Initialize cc::Renderer in vsync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/scheduler/scheduler_unittest.cc ('k') | cc/test/fake_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_TEST_FAKE_PROXY_H_ 5 #ifndef CC_TEST_FAKE_PROXY_H_
6 #define CC_TEST_FAKE_PROXY_H_ 6 #define CC_TEST_FAKE_PROXY_H_
7 7
8 #include "cc/base/thread.h" 8 #include "cc/base/thread.h"
9 #include "cc/trees/layer_tree_host.h" 9 #include "cc/trees/layer_tree_host.h"
10 #include "cc/trees/proxy.h" 10 #include "cc/trees/proxy.h"
11 11
12 namespace cc { 12 namespace cc {
13 13
14 class FakeProxy : public Proxy { 14 class FakeProxy : public Proxy {
15 public: 15 public:
16 explicit FakeProxy(scoped_ptr<Thread> impl_thread) 16 explicit FakeProxy(scoped_ptr<Thread> impl_thread)
17 : Proxy(impl_thread.Pass()) {} 17 : Proxy(impl_thread.Pass()),
18 layer_tree_host_(NULL) {}
19
20 void SetLayerTreeHost(LayerTreeHost* host);
18 21
19 virtual bool CompositeAndReadback(void* pixels, gfx::Rect rect) OVERRIDE; 22 virtual bool CompositeAndReadback(void* pixels, gfx::Rect rect) OVERRIDE;
20 virtual void FinishAllRendering() OVERRIDE {} 23 virtual void FinishAllRendering() OVERRIDE {}
21 virtual bool IsStarted() const OVERRIDE; 24 virtual bool IsStarted() const OVERRIDE;
22 virtual bool InitializeOutputSurface() OVERRIDE;
23 virtual void SetSurfaceReady() OVERRIDE {} 25 virtual void SetSurfaceReady() OVERRIDE {}
24 virtual void SetVisible(bool visible) OVERRIDE {} 26 virtual void SetVisible(bool visible) OVERRIDE {}
25 virtual bool InitializeRenderer() OVERRIDE; 27 virtual void CreateAndInitializeOutputSurface() OVERRIDE;
26 virtual bool RecreateOutputSurface() OVERRIDE;
27 virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE; 28 virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE;
28 virtual void SetNeedsAnimate() OVERRIDE {} 29 virtual void SetNeedsAnimate() OVERRIDE {}
29 virtual void SetNeedsCommit() OVERRIDE {} 30 virtual void SetNeedsCommit() OVERRIDE {}
30 virtual void SetNeedsRedraw(gfx::Rect damage_rect) OVERRIDE {} 31 virtual void SetNeedsRedraw(gfx::Rect damage_rect) OVERRIDE {}
31 virtual void SetDeferCommits(bool defer_commits) OVERRIDE {} 32 virtual void SetDeferCommits(bool defer_commits) OVERRIDE {}
32 virtual void MainThreadHasStoppedFlinging() OVERRIDE {} 33 virtual void MainThreadHasStoppedFlinging() OVERRIDE {}
33 virtual bool CommitRequested() const OVERRIDE; 34 virtual bool CommitRequested() const OVERRIDE;
34 virtual void Start() OVERRIDE {} 35 virtual void Start(scoped_ptr<OutputSurface> first_output_surface) OVERRIDE {}
35 virtual void Stop() OVERRIDE {} 36 virtual void Stop() OVERRIDE {}
36 virtual void ForceSerializeOnSwapBuffers() OVERRIDE {} 37 virtual void ForceSerializeOnSwapBuffers() OVERRIDE {}
37 virtual size_t MaxPartialTextureUpdates() const OVERRIDE; 38 virtual size_t MaxPartialTextureUpdates() const OVERRIDE;
38 virtual void AcquireLayerTextures() OVERRIDE {} 39 virtual void AcquireLayerTextures() OVERRIDE {}
39 virtual bool CommitPendingForTesting() OVERRIDE; 40 virtual bool CommitPendingForTesting() OVERRIDE;
40 virtual skia::RefPtr<SkPicture> CapturePicture() OVERRIDE; 41 virtual skia::RefPtr<SkPicture> CapturePicture() OVERRIDE;
41 virtual scoped_ptr<base::Value> AsValue() const OVERRIDE; 42 virtual scoped_ptr<base::Value> AsValue() const OVERRIDE;
42 43
43 virtual RendererCapabilities& GetRendererCapabilities(); 44 virtual RendererCapabilities& GetRendererCapabilities();
44 void SetMaxPartialTextureUpdates(size_t max); 45 void SetMaxPartialTextureUpdates(size_t max);
45 46
46 private: 47 private:
47 RendererCapabilities capabilities_; 48 RendererCapabilities capabilities_;
48 size_t max_partial_texture_updates_; 49 size_t max_partial_texture_updates_;
50 LayerTreeHost* layer_tree_host_;
49 }; 51 };
50 52
51 } // namespace cc 53 } // namespace cc
52 54
53 #endif // CC_TEST_FAKE_PROXY_H_ 55 #endif // CC_TEST_FAKE_PROXY_H_
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler_unittest.cc ('k') | cc/test/fake_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698