| 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 #include "cc/surfaces/surface_factory.h" | 5 #include "cc/surfaces/surface_factory.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 EXPECT_EQ(expected_sync_token, resource.sync_token); | 144 EXPECT_EQ(expected_sync_token, resource.sync_token); |
| 145 EXPECT_EQ(expected_returned_ids[i], resource.id); | 145 EXPECT_EQ(expected_returned_ids[i], resource.id); |
| 146 EXPECT_EQ(expected_returned_counts[i], resource.count); | 146 EXPECT_EQ(expected_returned_counts[i], resource.count); |
| 147 } | 147 } |
| 148 client_.clear_returned_resources(); | 148 client_.clear_returned_resources(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 void RefCurrentFrameResources() { | 151 void RefCurrentFrameResources() { |
| 152 Surface* surface = manager_.GetSurfaceForId( | 152 Surface* surface = manager_.GetSurfaceForId( |
| 153 SurfaceId(factory_->frame_sink_id(), local_surface_id_)); | 153 SurfaceId(factory_->frame_sink_id(), local_surface_id_)); |
| 154 factory_->RefResources(surface->GetEligibleFrame().resource_list); | 154 factory_->RefResources(surface->GetActiveFrame().resource_list); |
| 155 } | 155 } |
| 156 | 156 |
| 157 protected: | 157 protected: |
| 158 SurfaceManager manager_; | 158 SurfaceManager manager_; |
| 159 TestSurfaceFactoryClient client_; | 159 TestSurfaceFactoryClient client_; |
| 160 std::unique_ptr<SurfaceFactory> factory_; | 160 std::unique_ptr<SurfaceFactory> factory_; |
| 161 LocalSurfaceId local_surface_id_; | 161 LocalSurfaceId local_surface_id_; |
| 162 SurfaceId last_created_surface_id_; | 162 SurfaceId last_created_surface_id_; |
| 163 SurfaceInfo last_surface_info_; | 163 SurfaceInfo last_surface_info_; |
| 164 | 164 |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 factory_->SubmitCompositorFrame(local_surface_id_, std::move(frame), | 696 factory_->SubmitCompositorFrame(local_surface_id_, std::move(frame), |
| 697 SurfaceFactory::DrawCallback()); | 697 SurfaceFactory::DrawCallback()); |
| 698 SurfaceId expected_surface_id(factory_->frame_sink_id(), local_surface_id_); | 698 SurfaceId expected_surface_id(factory_->frame_sink_id(), local_surface_id_); |
| 699 EXPECT_EQ(expected_surface_id, last_surface_info_.id()); | 699 EXPECT_EQ(expected_surface_id, last_surface_info_.id()); |
| 700 EXPECT_EQ(2.5f, last_surface_info_.device_scale_factor()); | 700 EXPECT_EQ(2.5f, last_surface_info_.device_scale_factor()); |
| 701 EXPECT_EQ(gfx::Size(7, 8), last_surface_info_.size_in_pixels()); | 701 EXPECT_EQ(gfx::Size(7, 8), last_surface_info_.size_in_pixels()); |
| 702 } | 702 } |
| 703 | 703 |
| 704 } // namespace | 704 } // namespace |
| 705 } // namespace cc | 705 } // namespace cc |
| OLD | NEW |