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

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

Issue 2452483002: Move GpuMemoryBufferManager and SharedBitmapManager to CompositorFrameSink (Closed)
Patch Set: rebase Created 4 years, 1 month 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 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 if (!use_mus) { 507 if (!use_mus) {
508 display_output_surface = 508 display_output_surface =
509 base::MakeUnique<GpuBrowserCompositorOutputSurface>( 509 base::MakeUnique<GpuBrowserCompositorOutputSurface>(
510 context_provider, compositor->vsync_manager(), 510 context_provider, compositor->vsync_manager(),
511 begin_frame_source.get(), std::move(validator)); 511 begin_frame_source.get(), std::move(validator));
512 } else { 512 } else {
513 #if defined(USE_AURA) 513 #if defined(USE_AURA)
514 display_output_surface = 514 display_output_surface =
515 base::MakeUnique<MusBrowserCompositorOutputSurface>( 515 base::MakeUnique<MusBrowserCompositorOutputSurface>(
516 compositor->window(), context_provider, 516 compositor->window(), context_provider,
517 compositor->vsync_manager(), begin_frame_source.get(), 517 GetGpuMemoryBufferManager(), compositor->vsync_manager(),
518 std::move(validator)); 518 begin_frame_source.get(), std::move(validator));
519 #else 519 #else
520 NOTREACHED(); 520 NOTREACHED();
521 #endif 521 #endif
522 } 522 }
523 } 523 }
524 } 524 }
525 } 525 }
526 526
527 data->display_output_surface = display_output_surface.get(); 527 data->display_output_surface = display_output_surface.get();
528 data->begin_frame_source = begin_frame_source.get(); 528 data->begin_frame_source = begin_frame_source.get();
(...skipping 24 matching lines...) Expand all
553 auto compositor_frame_sink = 553 auto compositor_frame_sink =
554 vulkan_context_provider 554 vulkan_context_provider
555 ? base::MakeUnique<cc::DirectCompositorFrameSink>( 555 ? base::MakeUnique<cc::DirectCompositorFrameSink>(
556 compositor->frame_sink_id(), surface_manager_.get(), 556 compositor->frame_sink_id(), surface_manager_.get(),
557 data->display.get(), 557 data->display.get(),
558 static_cast<scoped_refptr<cc::VulkanContextProvider>>( 558 static_cast<scoped_refptr<cc::VulkanContextProvider>>(
559 vulkan_context_provider)) 559 vulkan_context_provider))
560 : base::MakeUnique<cc::DirectCompositorFrameSink>( 560 : base::MakeUnique<cc::DirectCompositorFrameSink>(
561 compositor->frame_sink_id(), surface_manager_.get(), 561 compositor->frame_sink_id(), surface_manager_.get(),
562 data->display.get(), context_provider, 562 data->display.get(), context_provider,
563 shared_worker_context_provider_); 563 shared_worker_context_provider_, GetGpuMemoryBufferManager(),
564 HostSharedBitmapManager::current());
564 data->display->Resize(compositor->size()); 565 data->display->Resize(compositor->size());
565 data->display->SetOutputIsSecure(data->output_is_secure); 566 data->display->SetOutputIsSecure(data->output_is_secure);
566 compositor->SetCompositorFrameSink(std::move(compositor_frame_sink)); 567 compositor->SetCompositorFrameSink(std::move(compositor_frame_sink));
567 } 568 }
568 569
569 std::unique_ptr<ui::Reflector> GpuProcessTransportFactory::CreateReflector( 570 std::unique_ptr<ui::Reflector> GpuProcessTransportFactory::CreateReflector(
570 ui::Compositor* source_compositor, 571 ui::Compositor* source_compositor,
571 ui::Layer* target_layer) { 572 ui::Layer* target_layer) {
572 PerCompositorData* source_data = 573 PerCompositorData* source_data =
573 per_compositor_data_[source_compositor].get(); 574 per_compositor_data_[source_compositor].get();
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 } 627 }
627 628
628 bool GpuProcessTransportFactory::DoesCreateTestContexts() { return false; } 629 bool GpuProcessTransportFactory::DoesCreateTestContexts() { return false; }
629 630
630 uint32_t GpuProcessTransportFactory::GetImageTextureTarget( 631 uint32_t GpuProcessTransportFactory::GetImageTextureTarget(
631 gfx::BufferFormat format, 632 gfx::BufferFormat format,
632 gfx::BufferUsage usage) { 633 gfx::BufferUsage usage) {
633 return BrowserGpuMemoryBufferManager::GetImageTextureTarget(format, usage); 634 return BrowserGpuMemoryBufferManager::GetImageTextureTarget(format, usage);
634 } 635 }
635 636
636 cc::SharedBitmapManager* GpuProcessTransportFactory::GetSharedBitmapManager() {
637 return HostSharedBitmapManager::current();
638 }
639
640 gpu::GpuMemoryBufferManager* 637 gpu::GpuMemoryBufferManager*
641 GpuProcessTransportFactory::GetGpuMemoryBufferManager() { 638 GpuProcessTransportFactory::GetGpuMemoryBufferManager() {
642 return gpu_channel_factory_->GetGpuMemoryBufferManager(); 639 return gpu_channel_factory_->GetGpuMemoryBufferManager();
643 } 640 }
644 641
645 cc::TaskGraphRunner* GpuProcessTransportFactory::GetTaskGraphRunner() { 642 cc::TaskGraphRunner* GpuProcessTransportFactory::GetTaskGraphRunner() {
646 return task_graph_runner_.get(); 643 return task_graph_runner_.get();
647 } 644 }
648 645
649 ui::ContextFactory* GpuProcessTransportFactory::GetContextFactory() { 646 ui::ContextFactory* GpuProcessTransportFactory::GetContextFactory() {
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 shared_vulkan_context_provider_ = 868 shared_vulkan_context_provider_ =
872 cc::VulkanInProcessContextProvider::Create(); 869 cc::VulkanInProcessContextProvider::Create();
873 } 870 }
874 871
875 shared_vulkan_context_provider_initialized_ = true; 872 shared_vulkan_context_provider_initialized_ = true;
876 } 873 }
877 return shared_vulkan_context_provider_; 874 return shared_vulkan_context_provider_;
878 } 875 }
879 876
880 } // namespace content 877 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698