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

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

Issue 2764153003: Fixing Display Mirror Mode issue (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | no next file » | 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 "content/browser/compositor/gpu_process_transport_factory.h" 5 #include "content/browser/compositor/gpu_process_transport_factory.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 DCHECK(begin_frame_source); 563 DCHECK(begin_frame_source);
564 display_output_surface = std::move(mus_output_surface); 564 display_output_surface = std::move(mus_output_surface);
565 #else 565 #else
566 NOTREACHED(); 566 NOTREACHED();
567 #endif 567 #endif
568 } 568 }
569 } 569 }
570 } 570 }
571 } 571 }
572 572
573 data->display_output_surface = display_output_surface.get();
574 if (data->reflector)
575 data->reflector->OnSourceSurfaceReady(data->display_output_surface);
576
573 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source; 577 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source;
574 std::unique_ptr<GpuVSyncBeginFrameSource> gpu_vsync_begin_frame_source; 578 std::unique_ptr<GpuVSyncBeginFrameSource> gpu_vsync_begin_frame_source;
575 579
576 if (!begin_frame_source) { 580 if (!begin_frame_source) {
577 if (!compositor->GetRendererSettings().disable_display_vsync) { 581 if (!compositor->GetRendererSettings().disable_display_vsync) {
578 if (gpu_vsync_control && IsGpuVSyncSignalSupported()) { 582 if (gpu_vsync_control && IsGpuVSyncSignalSupported()) {
579 gpu_vsync_begin_frame_source = 583 gpu_vsync_begin_frame_source =
580 base::MakeUnique<GpuVSyncBeginFrameSource>(gpu_vsync_control); 584 base::MakeUnique<GpuVSyncBeginFrameSource>(gpu_vsync_control);
581 begin_frame_source = gpu_vsync_begin_frame_source.get(); 585 begin_frame_source = gpu_vsync_begin_frame_source.get();
582 } else { 586 } else {
583 synthetic_begin_frame_source = 587 synthetic_begin_frame_source =
584 base::MakeUnique<cc::DelayBasedBeginFrameSource>( 588 base::MakeUnique<cc::DelayBasedBeginFrameSource>(
585 base::MakeUnique<cc::DelayBasedTimeSource>( 589 base::MakeUnique<cc::DelayBasedTimeSource>(
586 compositor->task_runner().get())); 590 compositor->task_runner().get()));
587 begin_frame_source = synthetic_begin_frame_source.get(); 591 begin_frame_source = synthetic_begin_frame_source.get();
588 } 592 }
589 } else { 593 } else {
590 synthetic_begin_frame_source = 594 synthetic_begin_frame_source =
591 base::MakeUnique<cc::BackToBackBeginFrameSource>( 595 base::MakeUnique<cc::BackToBackBeginFrameSource>(
592 base::MakeUnique<cc::DelayBasedTimeSource>( 596 base::MakeUnique<cc::DelayBasedTimeSource>(
593 compositor->task_runner().get())); 597 compositor->task_runner().get()));
594 begin_frame_source = synthetic_begin_frame_source.get(); 598 begin_frame_source = synthetic_begin_frame_source.get();
595 } 599 }
596 } 600 }
597 601
598 if (data->reflector)
599 data->reflector->OnSourceSurfaceReady(data->display_output_surface);
600
601 #if defined(OS_WIN) 602 #if defined(OS_WIN)
602 gfx::RenderingWindowManager::GetInstance()->DoSetParentOnChild( 603 gfx::RenderingWindowManager::GetInstance()->DoSetParentOnChild(
603 compositor->widget()); 604 compositor->widget());
604 #endif 605 #endif
605 606
606 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( 607 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler(
607 compositor->task_runner().get(), 608 compositor->task_runner().get(),
608 display_output_surface->capabilities().max_frames_pending)); 609 display_output_surface->capabilities().max_frames_pending));
609 610
610 // The Display owns and uses the |display_output_surface| created above. 611 // The Display owns and uses the |display_output_surface| created above.
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 shared_vulkan_context_provider_ = 951 shared_vulkan_context_provider_ =
951 cc::VulkanInProcessContextProvider::Create(); 952 cc::VulkanInProcessContextProvider::Create();
952 } 953 }
953 954
954 shared_vulkan_context_provider_initialized_ = true; 955 shared_vulkan_context_provider_initialized_ = true;
955 } 956 }
956 return shared_vulkan_context_provider_; 957 return shared_vulkan_context_provider_;
957 } 958 }
958 959
959 } // namespace content 960 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698