| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
| 10 #include "cc/output/begin_frame_args.h" | 10 #include "cc/output/begin_frame_args.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 namespace ui { | 26 namespace ui { |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 class FakeCompositorFrameSink : public cc::SurfaceFactoryClient { | 29 class FakeCompositorFrameSink : public cc::SurfaceFactoryClient { |
| 30 public: | 30 public: |
| 31 FakeCompositorFrameSink(const cc::FrameSinkId& frame_sink_id, | 31 FakeCompositorFrameSink(const cc::FrameSinkId& frame_sink_id, |
| 32 cc::SurfaceManager* manager) | 32 cc::SurfaceManager* manager) |
| 33 : frame_sink_id_(frame_sink_id), | 33 : frame_sink_id_(frame_sink_id), |
| 34 manager_(manager), | 34 manager_(manager), |
| 35 source_(nullptr), | 35 source_(nullptr), |
| 36 factory_(manager, this) { | 36 factory_(frame_sink_id, manager, this) { |
| 37 manager_->RegisterFrameSinkId(frame_sink_id_); | 37 manager_->RegisterFrameSinkId(frame_sink_id_); |
| 38 manager_->RegisterSurfaceFactoryClient(frame_sink_id_, this); | 38 manager_->RegisterSurfaceFactoryClient(frame_sink_id_, this); |
| 39 } | 39 } |
| 40 | 40 |
| 41 ~FakeCompositorFrameSink() override { | 41 ~FakeCompositorFrameSink() override { |
| 42 manager_->UnregisterSurfaceFactoryClient(frame_sink_id_); | 42 manager_->UnregisterSurfaceFactoryClient(frame_sink_id_); |
| 43 manager_->InvalidateFrameSinkId(frame_sink_id_); | 43 manager_->InvalidateFrameSinkId(frame_sink_id_); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void ReturnResources(const cc::ReturnedResourceArray& resources) override {} | 46 void ReturnResources(const cc::ReturnedResourceArray& resources) override {} |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 EXPECT_EQ(gfx::kNullAcceleratedWidget, | 149 EXPECT_EQ(gfx::kNullAcceleratedWidget, |
| 150 compositor()->ReleaseAcceleratedWidget()); | 150 compositor()->ReleaseAcceleratedWidget()); |
| 151 compositor()->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); | 151 compositor()->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); |
| 152 compositor()->SetVisible(true); | 152 compositor()->SetVisible(true); |
| 153 compositor()->ScheduleDraw(); | 153 compositor()->ScheduleDraw(); |
| 154 DrawWaiterForTest::WaitForCompositingEnded(compositor()); | 154 DrawWaiterForTest::WaitForCompositingEnded(compositor()); |
| 155 compositor()->SetRootLayer(nullptr); | 155 compositor()->SetRootLayer(nullptr); |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace ui | 158 } // namespace ui |
| OLD | NEW |