Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: cc/test/fake_output_surface.h

Issue 2009443002: Revert of Consolidate OutputSurface constructors into GL vs Vulkan. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/test/failure_output_surface.cc ('k') | cc/test/fake_output_surface.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 static std::unique_ptr<FakeOutputSurface> CreateSoftware( 54 static std::unique_ptr<FakeOutputSurface> CreateSoftware(
55 std::unique_ptr<SoftwareOutputDevice> software_device) { 55 std::unique_ptr<SoftwareOutputDevice> software_device) {
56 return base::WrapUnique( 56 return base::WrapUnique(
57 new FakeOutputSurface(std::move(software_device), false)); 57 new FakeOutputSurface(std::move(software_device), false));
58 } 58 }
59 59
60 static std::unique_ptr<FakeOutputSurface> 60 static std::unique_ptr<FakeOutputSurface>
61 Create3dWithResourcelessSoftwareSupport() { 61 Create3dWithResourcelessSoftwareSupport() {
62 return base::WrapUnique(new FakeOutputSurface( 62 return base::WrapUnique(new FakeOutputSurface(
63 TestContextProvider::Create(), TestContextProvider::CreateWorker(), 63 TestContextProvider::Create(),
64 base::WrapUnique(new SoftwareOutputDevice), false)); 64 base::WrapUnique(new SoftwareOutputDevice), false));
65 } 65 }
66 66
67 static std::unique_ptr<FakeOutputSurface> CreateDelegating3d() { 67 static std::unique_ptr<FakeOutputSurface> CreateDelegating3d() {
68 return base::WrapUnique( 68 return base::WrapUnique(
69 new FakeOutputSurface(TestContextProvider::Create(), 69 new FakeOutputSurface(TestContextProvider::Create(),
70 TestContextProvider::CreateWorker(), true)); 70 TestContextProvider::CreateWorker(), true));
71 } 71 }
72 72
73 static std::unique_ptr<FakeOutputSurface> CreateDelegating3d( 73 static std::unique_ptr<FakeOutputSurface> CreateDelegating3d(
(...skipping 17 matching lines...) Expand all
91 91
92 static std::unique_ptr<FakeOutputSurface> CreateNoRequireSyncPoint( 92 static std::unique_ptr<FakeOutputSurface> CreateNoRequireSyncPoint(
93 std::unique_ptr<TestWebGraphicsContext3D> context) { 93 std::unique_ptr<TestWebGraphicsContext3D> context) {
94 std::unique_ptr<FakeOutputSurface> surface(Create3d(std::move(context))); 94 std::unique_ptr<FakeOutputSurface> surface(Create3d(std::move(context)));
95 surface->capabilities_.delegated_sync_points_required = false; 95 surface->capabilities_.delegated_sync_points_required = false;
96 return surface; 96 return surface;
97 } 97 }
98 98
99 static std::unique_ptr<FakeOutputSurface> CreateOffscreen( 99 static std::unique_ptr<FakeOutputSurface> CreateOffscreen(
100 std::unique_ptr<TestWebGraphicsContext3D> context) { 100 std::unique_ptr<TestWebGraphicsContext3D> context) {
101 std::unique_ptr<FakeOutputSurface> surface( 101 std::unique_ptr<FakeOutputSurface> surface(new FakeOutputSurface(
102 new FakeOutputSurface(TestContextProvider::Create(std::move(context)), 102 TestContextProvider::Create(std::move(context)), false));
103 TestContextProvider::CreateWorker(), false));
104 surface->capabilities_.uses_default_gl_framebuffer = false; 103 surface->capabilities_.uses_default_gl_framebuffer = false;
105 return surface; 104 return surface;
106 } 105 }
107 106
108 void set_max_frames_pending(int max) { 107 void set_max_frames_pending(int max) {
109 capabilities_.max_frames_pending = max; 108 capabilities_.max_frames_pending = max;
110 } 109 }
111 110
112 CompositorFrame& last_sent_frame() { return last_sent_frame_; } 111 CompositorFrame& last_sent_frame() { return last_sent_frame_; }
113 size_t num_sent_frames() { return num_sent_frames_; } 112 size_t num_sent_frames() { return num_sent_frames_; }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 145 }
147 146
148 void SetMemoryPolicyToSetAtBind( 147 void SetMemoryPolicyToSetAtBind(
149 std::unique_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind); 148 std::unique_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind);
150 149
151 gfx::Rect last_swap_rect() const { 150 gfx::Rect last_swap_rect() const {
152 return last_swap_rect_; 151 return last_swap_rect_;
153 } 152 }
154 153
155 protected: 154 protected:
155 FakeOutputSurface(
156 scoped_refptr<ContextProvider> context_provider,
157 bool delegated_rendering);
158
156 FakeOutputSurface(scoped_refptr<ContextProvider> context_provider, 159 FakeOutputSurface(scoped_refptr<ContextProvider> context_provider,
157 scoped_refptr<ContextProvider> worker_context_provider, 160 scoped_refptr<ContextProvider> worker_context_provider,
158 bool delegated_rendering); 161 bool delegated_rendering);
159 162
160 FakeOutputSurface(std::unique_ptr<SoftwareOutputDevice> software_device, 163 FakeOutputSurface(std::unique_ptr<SoftwareOutputDevice> software_device,
161 bool delegated_rendering); 164 bool delegated_rendering);
162 165
163 FakeOutputSurface(scoped_refptr<ContextProvider> context_provider, 166 FakeOutputSurface(scoped_refptr<ContextProvider> context_provider,
164 scoped_refptr<ContextProvider> worker_context_provider,
165 std::unique_ptr<SoftwareOutputDevice> software_device, 167 std::unique_ptr<SoftwareOutputDevice> software_device,
166 bool delegated_rendering); 168 bool delegated_rendering);
167 169
168 OutputSurfaceClient* client_; 170 OutputSurfaceClient* client_;
169 CompositorFrame last_sent_frame_; 171 CompositorFrame last_sent_frame_;
170 size_t num_sent_frames_; 172 size_t num_sent_frames_;
171 bool has_external_stencil_test_; 173 bool has_external_stencil_test_;
172 bool suspended_for_recycle_; 174 bool suspended_for_recycle_;
173 unsigned framebuffer_; 175 unsigned framebuffer_;
174 TransferableResourceArray resources_held_by_parent_; 176 TransferableResourceArray resources_held_by_parent_;
175 std::unique_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind_; 177 std::unique_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind_;
176 OverlayCandidateValidator* overlay_candidate_validator_; 178 OverlayCandidateValidator* overlay_candidate_validator_;
177 gfx::Rect last_swap_rect_; 179 gfx::Rect last_swap_rect_;
178 }; 180 };
179 181
180 } // namespace cc 182 } // namespace cc
181 183
182 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ 184 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_
OLDNEW
« no previous file with comments | « cc/test/failure_output_surface.cc ('k') | cc/test/fake_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698