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

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

Issue 2321883002: cc: Remove SetMemoryPolicy from OutputSurface and Display. (Closed)
Patch Set: nits Created 4 years, 3 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_display_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"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/memory/ptr_util.h" 12 #include "base/memory/ptr_util.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "cc/output/begin_frame_args.h" 14 #include "cc/output/begin_frame_args.h"
15 #include "cc/output/compositor_frame.h" 15 #include "cc/output/compositor_frame.h"
16 #include "cc/output/managed_memory_policy.h"
17 #include "cc/output/output_surface.h" 16 #include "cc/output/output_surface.h"
18 #include "cc/output/software_output_device.h" 17 #include "cc/output/software_output_device.h"
19 #include "cc/test/test_context_provider.h" 18 #include "cc/test/test_context_provider.h"
20 #include "cc/test/test_gles2_interface.h" 19 #include "cc/test/test_gles2_interface.h"
21 #include "cc/test/test_web_graphics_context_3d.h" 20 #include "cc/test/test_web_graphics_context_3d.h"
22 21
23 namespace cc { 22 namespace cc {
24 23
25 class FakeOutputSurface : public OutputSurface { 24 class FakeOutputSurface : public OutputSurface {
26 public: 25 public:
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 135 }
137 136
138 void set_has_external_stencil_test(bool has_test) { 137 void set_has_external_stencil_test(bool has_test) {
139 has_external_stencil_test_ = has_test; 138 has_external_stencil_test_ = has_test;
140 } 139 }
141 140
142 void set_suspended_for_recycle(bool suspended) { 141 void set_suspended_for_recycle(bool suspended) {
143 suspended_for_recycle_ = suspended; 142 suspended_for_recycle_ = suspended;
144 } 143 }
145 144
146 void SetMemoryPolicyToSetAtBind(
147 std::unique_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind);
148
149 gfx::Rect last_swap_rect() const { 145 gfx::Rect last_swap_rect() const {
150 DCHECK(last_swap_rect_valid_); 146 DCHECK(last_swap_rect_valid_);
151 return last_swap_rect_; 147 return last_swap_rect_;
152 } 148 }
153 149
154 void ReturnResourcesHeldByParent(); 150 void ReturnResourcesHeldByParent();
155 151
156 protected: 152 protected:
157 FakeOutputSurface(scoped_refptr<ContextProvider> context_provider, 153 FakeOutputSurface(scoped_refptr<ContextProvider> context_provider,
158 scoped_refptr<ContextProvider> worker_context_provider, 154 scoped_refptr<ContextProvider> worker_context_provider,
159 bool delegated_rendering); 155 bool delegated_rendering);
160 156
161 FakeOutputSurface(scoped_refptr<ContextProvider> context_provider, 157 FakeOutputSurface(scoped_refptr<ContextProvider> context_provider,
162 scoped_refptr<ContextProvider> worker_context_provider, 158 scoped_refptr<ContextProvider> worker_context_provider,
163 std::unique_ptr<SoftwareOutputDevice> software_device, 159 std::unique_ptr<SoftwareOutputDevice> software_device,
164 bool delegated_rendering); 160 bool delegated_rendering);
165 161
166 OutputSurfaceClient* client_ = nullptr; 162 OutputSurfaceClient* client_ = nullptr;
167 std::unique_ptr<CompositorFrame> last_sent_frame_; 163 std::unique_ptr<CompositorFrame> last_sent_frame_;
168 size_t num_sent_frames_ = 0; 164 size_t num_sent_frames_ = 0;
169 bool has_external_stencil_test_ = false; 165 bool has_external_stencil_test_ = false;
170 bool suspended_for_recycle_ = false; 166 bool suspended_for_recycle_ = false;
171 GLint framebuffer_ = 0; 167 GLint framebuffer_ = 0;
172 GLenum framebuffer_format_ = 0; 168 GLenum framebuffer_format_ = 0;
173 TransferableResourceArray resources_held_by_parent_; 169 TransferableResourceArray resources_held_by_parent_;
174 std::unique_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind_;
175 OverlayCandidateValidator* overlay_candidate_validator_ = nullptr; 170 OverlayCandidateValidator* overlay_candidate_validator_ = nullptr;
176 bool last_swap_rect_valid_ = false; 171 bool last_swap_rect_valid_ = false;
177 gfx::Rect last_swap_rect_; 172 gfx::Rect last_swap_rect_;
178 }; 173 };
179 174
180 } // namespace cc 175 } // namespace cc
181 176
182 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ 177 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_
OLDNEW
« no previous file with comments | « cc/surfaces/surface_display_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