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

Side by Side Diff: content/browser/compositor/reflector_impl_unittest.cc

Issue 2612023002: cc: Implement overdraw feedback debugging feature. (Closed)
Patch Set: make sure overdraw_feedback_ is initialized and reset properly Created 3 years, 11 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/memory/ptr_util.h" 5 #include "base/memory/ptr_util.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "base/single_thread_task_runner.h" 7 #include "base/single_thread_task_runner.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "cc/output/output_surface_frame.h" 9 #include "cc/output/output_surface_frame.h"
10 #include "cc/scheduler/begin_frame_source.h" 10 #include "cc/scheduler/begin_frame_source.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 void SetFlip(bool flip) { capabilities_.flipped_output_surface = flip; } 84 void SetFlip(bool flip) { capabilities_.flipped_output_surface = flip; }
85 85
86 void BindToClient(cc::OutputSurfaceClient* client) override {} 86 void BindToClient(cc::OutputSurfaceClient* client) override {}
87 void EnsureBackbuffer() override {} 87 void EnsureBackbuffer() override {}
88 void DiscardBackbuffer() override {} 88 void DiscardBackbuffer() override {}
89 void BindFramebuffer() override {} 89 void BindFramebuffer() override {}
90 void Reshape(const gfx::Size& size, 90 void Reshape(const gfx::Size& size,
91 float device_scale_factor, 91 float device_scale_factor,
92 const gfx::ColorSpace& color_space, 92 const gfx::ColorSpace& color_space,
93 bool has_alpha) override {} 93 bool has_alpha,
94 bool use_stencil) override {}
94 void SwapBuffers(cc::OutputSurfaceFrame frame) override {} 95 void SwapBuffers(cc::OutputSurfaceFrame frame) override {}
95 uint32_t GetFramebufferCopyTextureFormat() override { return GL_RGB; } 96 uint32_t GetFramebufferCopyTextureFormat() override { return GL_RGB; }
96 bool IsDisplayedAsOverlayPlane() const override { return false; } 97 bool IsDisplayedAsOverlayPlane() const override { return false; }
97 unsigned GetOverlayTextureId() const override { return 0; } 98 unsigned GetOverlayTextureId() const override { return 0; }
98 bool SurfaceIsSuspendForRecycle() const override { return false; } 99 bool SurfaceIsSuspendForRecycle() const override { return false; }
99 100
100 void OnReflectorChanged() override { 101 void OnReflectorChanged() override {
101 if (!reflector_) { 102 if (!reflector_) {
102 reflector_texture_.reset(); 103 reflector_texture_.reset();
103 } else { 104 } else {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 145
145 auto context_provider = cc::TestContextProvider::Create(); 146 auto context_provider = cc::TestContextProvider::Create();
146 context_provider->BindToCurrentThread(); 147 context_provider->BindToCurrentThread();
147 output_surface_ = 148 output_surface_ =
148 base::MakeUnique<TestOutputSurface>(std::move(context_provider)); 149 base::MakeUnique<TestOutputSurface>(std::move(context_provider));
149 150
150 root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); 151 root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
151 compositor_->SetRootLayer(root_layer_.get()); 152 compositor_->SetRootLayer(root_layer_.get());
152 mirroring_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); 153 mirroring_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
153 compositor_->root_layer()->Add(mirroring_layer_.get()); 154 compositor_->root_layer()->Add(mirroring_layer_.get());
154 output_surface_->Reshape(kSurfaceSize, 1.f, gfx::ColorSpace(), false); 155 output_surface_->Reshape(kSurfaceSize, 1.f, gfx::ColorSpace(), false,
156 false);
155 mirroring_layer_->SetBounds(gfx::Rect(kSurfaceSize)); 157 mirroring_layer_->SetBounds(gfx::Rect(kSurfaceSize));
156 } 158 }
157 159
158 void SetUpReflector() { 160 void SetUpReflector() {
159 reflector_ = base::MakeUnique<ReflectorImpl>(compositor_.get(), 161 reflector_ = base::MakeUnique<ReflectorImpl>(compositor_.get(),
160 mirroring_layer_.get()); 162 mirroring_layer_.get());
161 reflector_->OnSourceSurfaceReady(output_surface_.get()); 163 reflector_->OnSourceSurfaceReady(output_surface_.get());
162 } 164 }
163 165
164 void TearDown() override { 166 void TearDown() override {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 plane_2.plane_z_order = 1; 231 plane_2.plane_z_order = 1;
230 list.push_back(plane_1); 232 list.push_back(plane_1);
231 list.push_back(plane_2); 233 list.push_back(plane_2);
232 output_surface_->GetOverlayCandidateValidator()->CheckOverlaySupport(&list); 234 output_surface_->GetOverlayCandidateValidator()->CheckOverlaySupport(&list);
233 EXPECT_FALSE(list[0].overlay_handled); 235 EXPECT_FALSE(list[0].overlay_handled);
234 } 236 }
235 #endif // defined(USE_OZONE) 237 #endif // defined(USE_OZONE)
236 238
237 } // namespace 239 } // namespace
238 } // namespace content 240 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698