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

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

Issue 2096493002: Make cc::CompositorFrames movable [Part 1 of 2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Dana's nits Created 4 years, 6 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/surfaces/surface_hittest_unittest.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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 new FakeOutputSurface(TestContextProvider::Create(std::move(context)), 102 new FakeOutputSurface(TestContextProvider::Create(std::move(context)),
103 TestContextProvider::CreateWorker(), false)); 103 TestContextProvider::CreateWorker(), false));
104 surface->capabilities_.uses_default_gl_framebuffer = false; 104 surface->capabilities_.uses_default_gl_framebuffer = false;
105 return surface; 105 return surface;
106 } 106 }
107 107
108 void set_max_frames_pending(int max) { 108 void set_max_frames_pending(int max) {
109 capabilities_.max_frames_pending = max; 109 capabilities_.max_frames_pending = max;
110 } 110 }
111 111
112 CompositorFrame& last_sent_frame() { return last_sent_frame_; } 112 CompositorFrame* last_sent_frame() { return last_sent_frame_.get(); }
113 size_t num_sent_frames() { return num_sent_frames_; } 113 size_t num_sent_frames() { return num_sent_frames_; }
114 114
115 void SwapBuffers(CompositorFrame* frame) override; 115 void SwapBuffers(CompositorFrame frame) override;
116 116
117 OutputSurfaceClient* client() { return client_; } 117 OutputSurfaceClient* client() { return client_; }
118 bool BindToClient(OutputSurfaceClient* client) override; 118 bool BindToClient(OutputSurfaceClient* client) override;
119 119
120 void set_framebuffer(GLint framebuffer, GLenum format) { 120 void set_framebuffer(GLint framebuffer, GLenum format) {
121 framebuffer_ = framebuffer; 121 framebuffer_ = framebuffer;
122 framebuffer_format_ = format; 122 framebuffer_format_ = format;
123 } 123 }
124 void BindFramebuffer() override; 124 void BindFramebuffer() override;
125 uint32_t GetFramebufferCopyTextureFormat() override; 125 uint32_t GetFramebufferCopyTextureFormat() override;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 163
164 FakeOutputSurface(std::unique_ptr<SoftwareOutputDevice> software_device, 164 FakeOutputSurface(std::unique_ptr<SoftwareOutputDevice> software_device,
165 bool delegated_rendering); 165 bool delegated_rendering);
166 166
167 FakeOutputSurface(scoped_refptr<ContextProvider> context_provider, 167 FakeOutputSurface(scoped_refptr<ContextProvider> context_provider,
168 scoped_refptr<ContextProvider> worker_context_provider, 168 scoped_refptr<ContextProvider> worker_context_provider,
169 std::unique_ptr<SoftwareOutputDevice> software_device, 169 std::unique_ptr<SoftwareOutputDevice> software_device,
170 bool delegated_rendering); 170 bool delegated_rendering);
171 171
172 OutputSurfaceClient* client_ = nullptr; 172 OutputSurfaceClient* client_ = nullptr;
173 CompositorFrame last_sent_frame_; 173 std::unique_ptr<CompositorFrame> last_sent_frame_;
174 size_t num_sent_frames_ = 0; 174 size_t num_sent_frames_ = 0;
175 bool has_external_stencil_test_ = false; 175 bool has_external_stencil_test_ = false;
176 bool suspended_for_recycle_ = false; 176 bool suspended_for_recycle_ = false;
177 GLint framebuffer_ = 0; 177 GLint framebuffer_ = 0;
178 GLenum framebuffer_format_ = 0; 178 GLenum framebuffer_format_ = 0;
179 TransferableResourceArray resources_held_by_parent_; 179 TransferableResourceArray resources_held_by_parent_;
180 std::unique_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind_; 180 std::unique_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind_;
181 OverlayCandidateValidator* overlay_candidate_validator_ = nullptr; 181 OverlayCandidateValidator* overlay_candidate_validator_ = nullptr;
182 gfx::Rect last_swap_rect_; 182 gfx::Rect last_swap_rect_;
183 }; 183 };
184 184
185 } // namespace cc 185 } // namespace cc
186 186
187 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ 187 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_
OLDNEW
« no previous file with comments | « cc/surfaces/surface_hittest_unittest.cc ('k') | cc/test/fake_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698