| OLD | NEW |
| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 class TestOutputSurface : public BrowserCompositorOutputSurface { | 78 class TestOutputSurface : public BrowserCompositorOutputSurface { |
| 79 public: | 79 public: |
| 80 TestOutputSurface(scoped_refptr<cc::ContextProvider> context_provider, | 80 TestOutputSurface(scoped_refptr<cc::ContextProvider> context_provider, |
| 81 scoped_refptr<ui::CompositorVSyncManager> vsync_manager, | 81 scoped_refptr<ui::CompositorVSyncManager> vsync_manager, |
| 82 cc::SyntheticBeginFrameSource* begin_frame_source) | 82 cc::SyntheticBeginFrameSource* begin_frame_source) |
| 83 : BrowserCompositorOutputSurface(std::move(context_provider), | 83 : BrowserCompositorOutputSurface(std::move(context_provider), |
| 84 std::move(vsync_manager), | 84 std::move(vsync_manager), |
| 85 begin_frame_source, | 85 begin_frame_source, |
| 86 CreateTestValidatorOzone()) { | 86 CreateTestValidatorOzone()) { |
| 87 device_scale_factor_ = 1.f; | |
| 88 } | 87 } |
| 89 | 88 |
| 90 void SetFlip(bool flip) { capabilities_.flipped_output_surface = flip; } | 89 void SetFlip(bool flip) { capabilities_.flipped_output_surface = flip; } |
| 91 | 90 |
| 92 void EnsureBackbuffer() override {} | 91 void EnsureBackbuffer() override {} |
| 93 void DiscardBackbuffer() override {} | 92 void DiscardBackbuffer() override {} |
| 94 void BindFramebuffer() override {} | 93 void BindFramebuffer() override {} |
| 95 void SwapBuffers(cc::OutputSurfaceFrame frame) override {} | 94 void SwapBuffers(cc::OutputSurfaceFrame frame) override {} |
| 96 uint32_t GetFramebufferCopyTextureFormat() override { return GL_RGB; } | 95 uint32_t GetFramebufferCopyTextureFormat() override { return GL_RGB; } |
| 97 bool IsDisplayedAsOverlayPlane() const override { return false; } | 96 bool IsDisplayedAsOverlayPlane() const override { return false; } |
| 98 unsigned GetOverlayTextureId() const override { return 0; } | 97 unsigned GetOverlayTextureId() const override { return 0; } |
| 99 bool SurfaceIsSuspendForRecycle() const override { return false; } | 98 bool SurfaceIsSuspendForRecycle() const override { return false; } |
| 100 | 99 |
| 101 void OnReflectorChanged() override { | 100 void OnReflectorChanged() override { |
| 102 if (!reflector_) { | 101 if (!reflector_) { |
| 103 reflector_texture_.reset(); | 102 reflector_texture_.reset(); |
| 104 } else { | 103 } else { |
| 105 reflector_texture_.reset(new ReflectorTexture(context_provider())); | 104 reflector_texture_.reset(new ReflectorTexture(context_provider())); |
| 106 reflector_->OnSourceTextureMailboxUpdated(reflector_texture_->mailbox()); | 105 reflector_->OnSourceTextureMailboxUpdated(reflector_texture_->mailbox()); |
| 107 } | 106 } |
| 108 } | 107 } |
| 109 | 108 |
| 110 void OnGpuSwapBuffersCompleted( | |
| 111 const std::vector<ui::LatencyInfo>& latency_info, | |
| 112 gfx::SwapResult result, | |
| 113 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) override { | |
| 114 NOTREACHED(); | |
| 115 } | |
| 116 | |
| 117 #if defined(OS_MACOSX) | 109 #if defined(OS_MACOSX) |
| 118 void SetSurfaceSuspendedForRecycle(bool suspended) override {} | 110 void SetSurfaceSuspendedForRecycle(bool suspended) override {} |
| 119 #endif | 111 #endif |
| 120 | 112 |
| 121 private: | 113 private: |
| 122 std::unique_ptr<ReflectorTexture> reflector_texture_; | 114 std::unique_ptr<ReflectorTexture> reflector_texture_; |
| 123 }; | 115 }; |
| 124 | 116 |
| 125 const gfx::Rect kSubRect(0, 0, 64, 64); | 117 const gfx::Rect kSubRect(0, 0, 64, 64); |
| 126 const gfx::Size kSurfaceSize(256, 256); | 118 const gfx::Size kSurfaceSize(256, 256); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 plane_2.plane_z_order = 1; | 225 plane_2.plane_z_order = 1; |
| 234 list.push_back(plane_1); | 226 list.push_back(plane_1); |
| 235 list.push_back(plane_2); | 227 list.push_back(plane_2); |
| 236 output_surface_->GetOverlayCandidateValidator()->CheckOverlaySupport(&list); | 228 output_surface_->GetOverlayCandidateValidator()->CheckOverlaySupport(&list); |
| 237 EXPECT_FALSE(list[0].overlay_handled); | 229 EXPECT_FALSE(list[0].overlay_handled); |
| 238 } | 230 } |
| 239 #endif // defined(USE_OZONE) | 231 #endif // defined(USE_OZONE) |
| 240 | 232 |
| 241 } // namespace | 233 } // namespace |
| 242 } // namespace content | 234 } // namespace content |
| OLD | NEW |