Re-subimission of https://codereview.chromium.org/1041213003/
[chromium-blink-merge.git] / content / public / test / test_synchronous_compositor_android.h
blobea8982a4900cd2b3af26e42e647a058d1629b6b5
1 // Copyright 2014 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 CONTENT_PUBLIC_TEST_TEST_SYNCHRONOUS_COMPOSITOR_ANDROID_H_
6 #define CONTENT_PUBLIC_TEST_TEST_SYNCHRONOUS_COMPOSITOR_ANDROID_H_
8 #include "content/public/browser/android/synchronous_compositor.h"
9 #include "content/public/browser/android/synchronous_compositor_client.h"
11 namespace content {
13 class CONTENT_EXPORT TestSynchronousCompositor : public SynchronousCompositor {
14 public:
15 TestSynchronousCompositor();
16 ~TestSynchronousCompositor() override;
18 void SetClient(SynchronousCompositorClient* client);
20 // SynchronousCompositor overrides.
21 bool InitializeHwDraw() override;
22 void ReleaseHwDraw() override;
23 scoped_ptr<cc::CompositorFrame> DemandDrawHw(
24 gfx::Size surface_size,
25 const gfx::Transform& transform,
26 gfx::Rect viewport,
27 gfx::Rect clip,
28 gfx::Rect viewport_rect_for_tile_priority,
29 const gfx::Transform& transform_for_tile_priority) override;
30 void ReturnResources(const cc::CompositorFrameAck& frame_ack) override;
31 bool DemandDrawSw(SkCanvas* canvas) override;
32 void SetMemoryPolicy(size_t bytes_limit) override;
33 void DidChangeRootLayerScrollOffset() override {}
34 void SetIsActive(bool is_active) override {}
36 private:
37 SynchronousCompositorClient* client_;
38 bool hardware_initialized_;
40 DISALLOW_COPY_AND_ASSIGN(TestSynchronousCompositor);
43 } // namespace content
45 #endif // CONTENT_PUBLIC_TEST_TEST_SYNCHRONOUS_COMPOSITOR_ANDROID_H_