| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_PUBLIC_TEST_TEST_SYNCHRONOUS_COMPOSITOR_ANDROID_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_SYNCHRONOUS_COMPOSITOR_ANDROID_H_ |
| 6 #define CONTENT_PUBLIC_TEST_TEST_SYNCHRONOUS_COMPOSITOR_ANDROID_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_SYNCHRONOUS_COMPOSITOR_ANDROID_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "content/public/browser/android/synchronous_compositor.h" | 9 #include "content/public/browser/android/synchronous_compositor.h" |
| 10 #include "content/public/browser/android/synchronous_compositor_client.h" | 10 #include "content/public/browser/android/synchronous_compositor_client.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 class CONTENT_EXPORT TestSynchronousCompositor : public SynchronousCompositor { | 14 class CONTENT_EXPORT TestSynchronousCompositor : public SynchronousCompositor { |
| 15 public: | 15 public: |
| 16 TestSynchronousCompositor(); | 16 TestSynchronousCompositor(); |
| 17 ~TestSynchronousCompositor() override; | 17 ~TestSynchronousCompositor() override; |
| 18 | 18 |
| 19 void SetClient(SynchronousCompositorClient* client); | 19 void SetClient(SynchronousCompositorClient* client); |
| 20 | 20 |
| 21 // SynchronousCompositor overrides. | 21 // SynchronousCompositor overrides. |
| 22 scoped_ptr<cc::CompositorFrame> DemandDrawHw( | 22 scoped_ptr<cc::CompositorFrame> DemandDrawHw( |
| 23 gfx::Size surface_size, | 23 const gfx::Size& surface_size, |
| 24 const gfx::Transform& transform, | 24 const gfx::Transform& transform, |
| 25 gfx::Rect viewport, | 25 const gfx::Rect& viewport, |
| 26 gfx::Rect clip, | 26 const gfx::Rect& clip, |
| 27 gfx::Rect viewport_rect_for_tile_priority, | 27 const gfx::Rect& viewport_rect_for_tile_priority, |
| 28 const gfx::Transform& transform_for_tile_priority) override; | 28 const gfx::Transform& transform_for_tile_priority) override; |
| 29 void ReturnResources(const cc::CompositorFrameAck& frame_ack) override {} | 29 void ReturnResources(const cc::CompositorFrameAck& frame_ack) override {} |
| 30 bool DemandDrawSw(SkCanvas* canvas) override; | 30 bool DemandDrawSw(SkCanvas* canvas) override; |
| 31 void SetMemoryPolicy(size_t bytes_limit) override {} | 31 void SetMemoryPolicy(size_t bytes_limit) override {} |
| 32 void DidChangeRootLayerScrollOffset( | 32 void DidChangeRootLayerScrollOffset( |
| 33 const gfx::ScrollOffset& root_offset) override {} | 33 const gfx::ScrollOffset& root_offset) override {} |
| 34 void SetIsActive(bool is_active) override {} | 34 void SetIsActive(bool is_active) override {} |
| 35 void OnComputeScroll(base::TimeTicks animate_time) override {} | 35 void OnComputeScroll(base::TimeTicks animate_time) override {} |
| 36 | 36 |
| 37 void SetHardwareFrame(scoped_ptr<cc::CompositorFrame> frame); | 37 void SetHardwareFrame(scoped_ptr<cc::CompositorFrame> frame); |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 SynchronousCompositorClient* client_; | 40 SynchronousCompositorClient* client_; |
| 41 scoped_ptr<cc::CompositorFrame> hardware_frame_; | 41 scoped_ptr<cc::CompositorFrame> hardware_frame_; |
| 42 | 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(TestSynchronousCompositor); | 43 DISALLOW_COPY_AND_ASSIGN(TestSynchronousCompositor); |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 } // namespace content | 46 } // namespace content |
| 47 | 47 |
| 48 #endif // CONTENT_PUBLIC_TEST_TEST_SYNCHRONOUS_COMPOSITOR_ANDROID_H_ | 48 #endif // CONTENT_PUBLIC_TEST_TEST_SYNCHRONOUS_COMPOSITOR_ANDROID_H_ |
| OLD | NEW |