| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/compositor_frame_sink_support.h" | 5 #include "cc/surfaces/compositor_frame_sink_support.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "cc/output/compositor_frame.h" | 8 #include "cc/output/compositor_frame.h" |
| 9 #include "cc/output/copy_output_request.h" | 9 #include "cc/output/copy_output_request.h" |
| 10 #include "cc/output/copy_output_result.h" | 10 #include "cc/output/copy_output_result.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 116 } |
| 117 | 117 |
| 118 // SurfaceObserver implementation. | 118 // SurfaceObserver implementation. |
| 119 void OnSurfaceCreated(const SurfaceInfo& surface_info) override { | 119 void OnSurfaceCreated(const SurfaceInfo& surface_info) override { |
| 120 last_created_surface_id_ = surface_info.id(); | 120 last_created_surface_id_ = surface_info.id(); |
| 121 last_surface_info_ = surface_info; | 121 last_surface_info_ = surface_info; |
| 122 } | 122 } |
| 123 void OnSurfaceDamaged(const SurfaceId& id, bool* changed) override { | 123 void OnSurfaceDamaged(const SurfaceId& id, bool* changed) override { |
| 124 *changed = true; | 124 *changed = true; |
| 125 } | 125 } |
| 126 void OnSurfaceProducerStateChanged(const SurfaceId& surface_id) override {} |
| 126 | 127 |
| 127 void SubmitCompositorFrameWithResources(ResourceId* resource_ids, | 128 void SubmitCompositorFrameWithResources(ResourceId* resource_ids, |
| 128 size_t num_resource_ids) { | 129 size_t num_resource_ids) { |
| 129 CompositorFrame frame = MakeCompositorFrame(); | 130 CompositorFrame frame = MakeCompositorFrame(); |
| 130 for (size_t i = 0u; i < num_resource_ids; ++i) { | 131 for (size_t i = 0u; i < num_resource_ids; ++i) { |
| 131 TransferableResource resource; | 132 TransferableResource resource; |
| 132 resource.id = resource_ids[i]; | 133 resource.id = resource_ids[i]; |
| 133 resource.mailbox_holder.texture_target = GL_TEXTURE_2D; | 134 resource.mailbox_holder.texture_target = GL_TEXTURE_2D; |
| 134 resource.mailbox_holder.sync_token = frame_sync_token_; | 135 resource.mailbox_holder.sync_token = frame_sync_token_; |
| 135 frame.resource_list.push_back(resource); | 136 frame.resource_list.push_back(resource); |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 EXPECT_EQ(expected_surface_id, last_surface_info_.id()); | 783 EXPECT_EQ(expected_surface_id, last_surface_info_.id()); |
| 783 EXPECT_EQ(2.5f, last_surface_info_.device_scale_factor()); | 784 EXPECT_EQ(2.5f, last_surface_info_.device_scale_factor()); |
| 784 EXPECT_EQ(gfx::Size(7, 8), last_surface_info_.size_in_pixels()); | 785 EXPECT_EQ(gfx::Size(7, 8), last_surface_info_.size_in_pixels()); |
| 785 } | 786 } |
| 786 | 787 |
| 787 } // namespace | 788 } // namespace |
| 788 | 789 |
| 789 } // namespace test | 790 } // namespace test |
| 790 | 791 |
| 791 } // namespace cc | 792 } // namespace cc |
| OLD | NEW |