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

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

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
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/compositor_frame.h"
9 #include "cc/scheduler/begin_frame_source.h" 10 #include "cc/scheduler/begin_frame_source.h"
10 #include "cc/scheduler/delay_based_time_source.h" 11 #include "cc/scheduler/delay_based_time_source.h"
11 #include "cc/test/fake_output_surface_client.h" 12 #include "cc/test/fake_output_surface_client.h"
12 #include "cc/test/test_context_provider.h" 13 #include "cc/test/test_context_provider.h"
13 #include "cc/test/test_web_graphics_context_3d.h" 14 #include "cc/test/test_web_graphics_context_3d.h"
14 #include "components/display_compositor/compositor_overlay_candidate_validator.h " 15 #include "components/display_compositor/compositor_overlay_candidate_validator.h "
15 #include "content/browser/compositor/browser_compositor_output_surface.h" 16 #include "content/browser/compositor/browser_compositor_output_surface.h"
16 #include "content/browser/compositor/reflector_impl.h" 17 #include "content/browser/compositor/reflector_impl.h"
17 #include "content/browser/compositor/reflector_texture.h" 18 #include "content/browser/compositor/reflector_texture.h"
18 #include "content/browser/compositor/test/no_transport_image_transport_factory.h " 19 #include "content/browser/compositor/test/no_transport_image_transport_factory.h "
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 : BrowserCompositorOutputSurface(std::move(context_provider), 82 : BrowserCompositorOutputSurface(std::move(context_provider),
82 std::move(vsync_manager), 83 std::move(vsync_manager),
83 begin_frame_source, 84 begin_frame_source,
84 CreateTestValidatorOzone()) { 85 CreateTestValidatorOzone()) {
85 surface_size_ = gfx::Size(256, 256); 86 surface_size_ = gfx::Size(256, 256);
86 device_scale_factor_ = 1.f; 87 device_scale_factor_ = 1.f;
87 } 88 }
88 89
89 void SetFlip(bool flip) { capabilities_.flipped_output_surface = flip; } 90 void SetFlip(bool flip) { capabilities_.flipped_output_surface = flip; }
90 91
91 void SwapBuffers(cc::CompositorFrame* frame) override {} 92 void SwapBuffers(cc::CompositorFrame frame) override {}
92 uint32_t GetFramebufferCopyTextureFormat() override { return GL_RGB; } 93 uint32_t GetFramebufferCopyTextureFormat() override { return GL_RGB; }
93 94
94 void OnReflectorChanged() override { 95 void OnReflectorChanged() override {
95 if (!reflector_) { 96 if (!reflector_) {
96 reflector_texture_.reset(); 97 reflector_texture_.reset();
97 } else { 98 } else {
98 reflector_texture_.reset(new ReflectorTexture(context_provider())); 99 reflector_texture_.reset(new ReflectorTexture(context_provider()));
99 reflector_->OnSourceTextureMailboxUpdated(reflector_texture_->mailbox()); 100 reflector_->OnSourceTextureMailboxUpdated(reflector_texture_->mailbox());
100 } 101 }
101 } 102 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 plane_2.plane_z_order = 1; 225 plane_2.plane_z_order = 1;
225 list.push_back(plane_1); 226 list.push_back(plane_1);
226 list.push_back(plane_2); 227 list.push_back(plane_2);
227 output_surface_->GetOverlayCandidateValidator()->CheckOverlaySupport(&list); 228 output_surface_->GetOverlayCandidateValidator()->CheckOverlaySupport(&list);
228 EXPECT_FALSE(list[0].overlay_handled); 229 EXPECT_FALSE(list[0].overlay_handled);
229 } 230 }
230 #endif // defined(USE_OZONE) 231 #endif // defined(USE_OZONE)
231 232
232 } // namespace 233 } // namespace
233 } // namespace content 234 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698