Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

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

Issue 2727553004: [cc] Forward BeginFrameAcks through DirectCFS and CFSSupport. (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_COMPOSITOR_FRAME_SINK_CLIENT_H_ 5 #ifndef CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_CLIENT_H_
6 #define CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_CLIENT_H_ 6 #define CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_CLIENT_H_
7 7
8 #include "cc/output/compositor_frame_sink_client.h" 8 #include "cc/output/compositor_frame_sink_client.h"
9 #include "cc/output/managed_memory_policy.h" 9 #include "cc/output/managed_memory_policy.h"
10 10
11 namespace cc { 11 namespace cc {
12 12
13 class FakeCompositorFrameSinkClient : public CompositorFrameSinkClient { 13 class FakeCompositorFrameSinkClient : public CompositorFrameSinkClient {
14 public: 14 public:
15 FakeCompositorFrameSinkClient() : memory_policy_(0) {} 15 FakeCompositorFrameSinkClient() : memory_policy_(0) {}
16 16
17 void SetBeginFrameSource(BeginFrameSource* source) override {} 17 void SetBeginFrameSource(BeginFrameSource* source) override;
18 void DidReceiveCompositorFrameAck() override; 18 void DidReceiveCompositorFrameAck() override;
19 void ReclaimResources(const ReturnedResourceArray& resources) override {} 19 void ReclaimResources(const ReturnedResourceArray& resources) override {}
20 void DidLoseCompositorFrameSink() override; 20 void DidLoseCompositorFrameSink() override;
21 void SetExternalTilePriorityConstraints( 21 void SetExternalTilePriorityConstraints(
22 const gfx::Rect& viewport_rect_for_tile_priority, 22 const gfx::Rect& viewport_rect_for_tile_priority,
23 const gfx::Transform& transform_for_tile_priority) override {} 23 const gfx::Transform& transform_for_tile_priority) override {}
24 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; 24 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override;
25 void SetTreeActivationCallback(const base::Closure&) override {} 25 void SetTreeActivationCallback(const base::Closure&) override {}
26 void OnDraw(const gfx::Transform& transform, 26 void OnDraw(const gfx::Transform& transform,
27 const gfx::Rect& viewport, 27 const gfx::Rect& viewport,
28 bool resourceless_software_draw) override {} 28 bool resourceless_software_draw) override {}
29 29
30 int ack_count() { return ack_count_; } 30 int ack_count() { return ack_count_; }
31 31
32 bool did_lose_compositor_frame_sink_called() { 32 bool did_lose_compositor_frame_sink_called() {
33 return did_lose_compositor_frame_sink_called_; 33 return did_lose_compositor_frame_sink_called_;
34 } 34 }
35 35
36 const ManagedMemoryPolicy& memory_policy() const { return memory_policy_; } 36 const ManagedMemoryPolicy& memory_policy() const { return memory_policy_; }
37 37
38 BeginFrameSource* begin_frame_source() const { return begin_frame_source_; }
39
38 private: 40 private:
39 int ack_count_ = 0; 41 int ack_count_ = 0;
40 bool did_lose_compositor_frame_sink_called_ = false; 42 bool did_lose_compositor_frame_sink_called_ = false;
41 ManagedMemoryPolicy memory_policy_; 43 ManagedMemoryPolicy memory_policy_;
44 BeginFrameSource* begin_frame_source_;
42 }; 45 };
43 46
44 } // namespace cc 47 } // namespace cc
45 48
46 #endif // CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_CLIENT_H_ 49 #endif // CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698