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

Side by Side Diff: cc/output/overlay_unittest.cc

Issue 2399983003: cc: Make OutputSurface::Reshape abstract (Closed)
Patch Set: reshapeabstract: . Created 4 years, 2 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/output/output_surface_unittest.cc ('k') | cc/output/software_output_device.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 size_t DefaultOverlayProcessor::GetStrategyCount() { 146 size_t DefaultOverlayProcessor::GetStrategyCount() {
147 return strategies_.size(); 147 return strategies_.size();
148 } 148 }
149 149
150 class OverlayOutputSurface : public OutputSurface { 150 class OverlayOutputSurface : public OutputSurface {
151 public: 151 public:
152 explicit OverlayOutputSurface( 152 explicit OverlayOutputSurface(
153 scoped_refptr<TestContextProvider> context_provider) 153 scoped_refptr<TestContextProvider> context_provider)
154 : OutputSurface(std::move(context_provider)) { 154 : OutputSurface(std::move(context_provider)) {
155 surface_size_ = kDisplaySize;
156 device_scale_factor_ = 1;
157 is_displayed_as_overlay_plane_ = true; 155 is_displayed_as_overlay_plane_ = true;
158 } 156 }
159 157
160 // OutputSurface implementation. 158 // OutputSurface implementation.
161 void EnsureBackbuffer() override {} 159 void EnsureBackbuffer() override {}
162 void DiscardBackbuffer() override {} 160 void DiscardBackbuffer() override {}
163 void BindFramebuffer() override { 161 void BindFramebuffer() override {
164 bind_framebuffer_count_ += 1; 162 bind_framebuffer_count_ += 1;
165 } 163 }
164 void Reshape(const gfx::Size& size,
165 float device_scale_factor,
166 const gfx::ColorSpace& color_space,
167 bool has_alpha) override {}
168 void SwapBuffers(OutputSurfaceFrame frame) override {}
166 uint32_t GetFramebufferCopyTextureFormat() override { 169 uint32_t GetFramebufferCopyTextureFormat() override {
167 // TestContextProvider has no real framebuffer, just use RGB. 170 // TestContextProvider has no real framebuffer, just use RGB.
168 return GL_RGB; 171 return GL_RGB;
169 } 172 }
170 void SwapBuffers(OutputSurfaceFrame frame) override {}
171 bool HasExternalStencilTest() const override { return false; } 173 bool HasExternalStencilTest() const override { return false; }
172 void ApplyExternalStencil() override {} 174 void ApplyExternalStencil() override {}
173 OverlayCandidateValidator* GetOverlayCandidateValidator() const override { 175 OverlayCandidateValidator* GetOverlayCandidateValidator() const override {
174 return overlay_candidate_validator_.get(); 176 return overlay_candidate_validator_.get();
175 } 177 }
176 bool IsDisplayedAsOverlayPlane() const override { 178 bool IsDisplayedAsOverlayPlane() const override {
177 return is_displayed_as_overlay_plane_; 179 return is_displayed_as_overlay_plane_;
178 } 180 }
179 unsigned GetOverlayTextureId() const override { return 10000; } 181 unsigned GetOverlayTextureId() const override { return 10000; }
180 void set_is_displayed_as_overlay_plane(bool value) {
181 is_displayed_as_overlay_plane_ = value;
182 }
183 bool SurfaceIsSuspendForRecycle() const override { return false; } 182 bool SurfaceIsSuspendForRecycle() const override { return false; }
184 183
185 void OnSwapBuffersComplete() { client_->DidSwapBuffersComplete(); } 184 void OnSwapBuffersComplete() { client_->DidSwapBuffersComplete(); }
186 185
187 void SetScaleFactor(float scale_factor) { 186 void set_is_displayed_as_overlay_plane(bool value) {
188 device_scale_factor_ = scale_factor; 187 is_displayed_as_overlay_plane_ = value;
189 } 188 }
190 189
191 void SetOverlayCandidateValidator(OverlayCandidateValidator* validator) { 190 void SetOverlayCandidateValidator(OverlayCandidateValidator* validator) {
192 overlay_candidate_validator_.reset(validator); 191 overlay_candidate_validator_.reset(validator);
193 } 192 }
194 193
195 unsigned bind_framebuffer_count() const { return bind_framebuffer_count_; } 194 unsigned bind_framebuffer_count() const { return bind_framebuffer_count_; }
196 195
197 private: 196 private:
198 std::unique_ptr<OverlayCandidateValidator> overlay_candidate_validator_; 197 std::unique_ptr<OverlayCandidateValidator> overlay_candidate_validator_;
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after
1898 gfx::Size(), filters_, gfx::Vector2dF(1, 1), gfx::PointF(), 1897 gfx::Size(), filters_, gfx::Vector2dF(1, 1), gfx::PointF(),
1899 background_filters_); 1898 background_filters_);
1900 } 1899 }
1901 1900
1902 ProcessForOverlays(); 1901 ProcessForOverlays();
1903 EXPECT_EQ(0U, ca_layer_list_.size()); 1902 EXPECT_EQ(0U, ca_layer_list_.size());
1904 } 1903 }
1905 1904
1906 } // namespace 1905 } // namespace
1907 } // namespace cc 1906 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/output_surface_unittest.cc ('k') | cc/output/software_output_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698