Setup a experiment to enable background tracing.
[chromium-blink-merge.git] / cc / test / fake_output_surface_client.h
blobbb31cfadb50d97ea5275b637edd9596e5fbddaf9
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
3 // found in the LICENSE file.
5 #ifndef CC_TEST_FAKE_OUTPUT_SURFACE_CLIENT_H_
6 #define CC_TEST_FAKE_OUTPUT_SURFACE_CLIENT_H_
8 #include "cc/output/managed_memory_policy.h"
9 #include "cc/output/output_surface_client.h"
11 namespace cc {
13 class OutputSurface;
15 class FakeOutputSurfaceClient : public OutputSurfaceClient {
16 public:
17 FakeOutputSurfaceClient()
18 : swap_count_(0),
19 did_lose_output_surface_called_(false),
20 memory_policy_(0) {}
22 void CommitVSyncParameters(base::TimeTicks timebase,
23 base::TimeDelta interval) override {}
24 void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override {}
25 void DidSwapBuffers() override;
26 void DidSwapBuffersComplete() override {}
27 void ReclaimResources(const CompositorFrameAck* ack) override {}
28 void DidLoseOutputSurface() override;
29 void SetExternalDrawConstraints(
30 const gfx::Transform& transform,
31 const gfx::Rect& viewport,
32 const gfx::Rect& clip,
33 const gfx::Rect& viewport_rect_for_tile_priority,
34 const gfx::Transform& transform_for_tile_priority,
35 bool resourceless_software_draw) override {}
36 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override;
37 void SetTreeActivationCallback(const base::Closure&) override {}
38 void OnDraw() override {}
40 int swap_count() { return swap_count_; }
42 bool did_lose_output_surface_called() {
43 return did_lose_output_surface_called_;
46 const ManagedMemoryPolicy& memory_policy() const { return memory_policy_; }
48 private:
49 int swap_count_;
50 bool did_lose_output_surface_called_;
51 ManagedMemoryPolicy memory_policy_;
54 } // namespace cc
56 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_CLIENT_H_