| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 CC_TEST_FAKE_OUTPUT_SURFACE_H_ | 5 #ifndef CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
| 6 #define CC_TEST_FAKE_OUTPUT_SURFACE_H_ | 6 #define CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 return base::WrapUnique(new FakeOutputSurface( | 54 return base::WrapUnique(new FakeOutputSurface( |
| 55 TestContextProvider::Create(std::move(context)), nullptr, false)); | 55 TestContextProvider::Create(std::move(context)), nullptr, false)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 static std::unique_ptr<FakeOutputSurface> CreateSoftware( | 58 static std::unique_ptr<FakeOutputSurface> CreateSoftware( |
| 59 std::unique_ptr<SoftwareOutputDevice> software_device) { | 59 std::unique_ptr<SoftwareOutputDevice> software_device) { |
| 60 return base::WrapUnique(new FakeOutputSurface( | 60 return base::WrapUnique(new FakeOutputSurface( |
| 61 nullptr, nullptr, std::move(software_device), false)); | 61 nullptr, nullptr, std::move(software_device), false)); |
| 62 } | 62 } |
| 63 | 63 |
| 64 static std::unique_ptr<FakeOutputSurface> CreateDelegating3d() { | |
| 65 return base::WrapUnique( | |
| 66 new FakeOutputSurface(TestContextProvider::Create(), | |
| 67 TestContextProvider::CreateWorker(), true)); | |
| 68 } | |
| 69 | |
| 70 static std::unique_ptr<FakeOutputSurface> CreateDelegating3d( | |
| 71 scoped_refptr<TestContextProvider> context_provider) { | |
| 72 return base::WrapUnique(new FakeOutputSurface( | |
| 73 context_provider, TestContextProvider::CreateWorker(), true)); | |
| 74 } | |
| 75 | |
| 76 static std::unique_ptr<FakeOutputSurface> CreateDelegating3d( | |
| 77 std::unique_ptr<TestWebGraphicsContext3D> context) { | |
| 78 return base::WrapUnique( | |
| 79 new FakeOutputSurface(TestContextProvider::Create(std::move(context)), | |
| 80 TestContextProvider::CreateWorker(), true)); | |
| 81 } | |
| 82 | |
| 83 static std::unique_ptr<FakeOutputSurface> CreateDelegatingSoftware() { | |
| 84 return base::WrapUnique( | |
| 85 new FakeOutputSurface(nullptr, nullptr, nullptr, true)); | |
| 86 } | |
| 87 | |
| 88 static std::unique_ptr<FakeOutputSurface> CreateNoRequireSyncPoint( | 64 static std::unique_ptr<FakeOutputSurface> CreateNoRequireSyncPoint( |
| 89 std::unique_ptr<TestWebGraphicsContext3D> context) { | 65 std::unique_ptr<TestWebGraphicsContext3D> context) { |
| 90 std::unique_ptr<FakeOutputSurface> surface(Create3d(std::move(context))); | 66 std::unique_ptr<FakeOutputSurface> surface(Create3d(std::move(context))); |
| 91 surface->capabilities_.delegated_sync_points_required = false; | 67 surface->capabilities_.delegated_sync_points_required = false; |
| 92 return surface; | 68 return surface; |
| 93 } | 69 } |
| 94 | 70 |
| 95 static std::unique_ptr<FakeOutputSurface> CreateOffscreen( | 71 static std::unique_ptr<FakeOutputSurface> CreateOffscreen( |
| 96 std::unique_ptr<TestWebGraphicsContext3D> context) { | 72 std::unique_ptr<TestWebGraphicsContext3D> context) { |
| 97 std::unique_ptr<FakeOutputSurface> surface( | 73 std::unique_ptr<FakeOutputSurface> surface( |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 GLenum framebuffer_format_ = 0; | 144 GLenum framebuffer_format_ = 0; |
| 169 TransferableResourceArray resources_held_by_parent_; | 145 TransferableResourceArray resources_held_by_parent_; |
| 170 OverlayCandidateValidator* overlay_candidate_validator_ = nullptr; | 146 OverlayCandidateValidator* overlay_candidate_validator_ = nullptr; |
| 171 bool last_swap_rect_valid_ = false; | 147 bool last_swap_rect_valid_ = false; |
| 172 gfx::Rect last_swap_rect_; | 148 gfx::Rect last_swap_rect_; |
| 173 }; | 149 }; |
| 174 | 150 |
| 175 } // namespace cc | 151 } // namespace cc |
| 176 | 152 |
| 177 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ | 153 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
| OLD | NEW |