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

Side by Side Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 2857363004: Add buffer_to_texture_target_map to LayerTreeSettings (Closed)
Patch Set: Revert changes in MusContextFactory Created 3 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
« no previous file with comments | « cc/trees/layer_tree_settings.h ('k') | content/renderer/gpu/render_widget_compositor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer_host/compositor_impl_android.h" 5 #include "content/browser/renderer_host/compositor_impl_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 #include <android/native_window_jni.h> 8 #include <android/native_window_jni.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <unordered_set> 10 #include <unordered_set>
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 gpu::GpuSurfaceTracker::SurfaceRecord(window, surface)); 509 gpu::GpuSurfaceTracker::SurfaceRecord(window, surface));
510 SetVisible(true); 510 SetVisible(true);
511 ANativeWindow_release(window); 511 ANativeWindow_release(window);
512 } 512 }
513 } 513 }
514 514
515 void CompositorImpl::CreateLayerTreeHost() { 515 void CompositorImpl::CreateLayerTreeHost() {
516 DCHECK(!host_); 516 DCHECK(!host_);
517 517
518 cc::LayerTreeSettings settings; 518 cc::LayerTreeSettings settings;
519 settings.renderer_settings.refresh_rate = 60.0;
520 settings.renderer_settings.allow_antialiasing = false;
521 settings.renderer_settings.highp_threshold_min = 2048;
522 settings.use_zero_copy = true; 519 settings.use_zero_copy = true;
523 520
524 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 521 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
525 settings.initial_debug_state.SetRecordRenderingStats( 522 settings.initial_debug_state.SetRecordRenderingStats(
526 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); 523 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking));
527 settings.initial_debug_state.show_fps_counter = 524 settings.initial_debug_state.show_fps_counter =
528 command_line->HasSwitch(cc::switches::kUIShowFPSCounter); 525 command_line->HasSwitch(cc::switches::kUIShowFPSCounter);
529 settings.single_thread_proxy_scheduler = true; 526 settings.single_thread_proxy_scheduler = true;
530 527
531 animation_host_ = cc::AnimationHost::CreateMainInstance(); 528 animation_host_ = cc::AnimationHost::CreateMainInstance();
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 762
766 pending_frames_ = 0; 763 pending_frames_ = 0;
767 num_successive_context_creation_failures_ = 0; 764 num_successive_context_creation_failures_ = 0;
768 765
769 if (context_provider) { 766 if (context_provider) {
770 gpu_capabilities_ = context_provider->ContextCapabilities(); 767 gpu_capabilities_ = context_provider->ContextCapabilities();
771 } else { 768 } else {
772 // TODO(danakj): Populate gpu_capabilities_ for VulkanContextProvider. 769 // TODO(danakj): Populate gpu_capabilities_ for VulkanContextProvider.
773 } 770 }
774 771
772 cc::RendererSettings renderer_settings;
boliu 2017/05/25 23:44:44 it's not clear to me why this change is relevant t
Alex Z. 2017/05/26 12:48:58 You are right. I have reverted this changes. This
773 renderer_settings.allow_antialiasing = false;
774 renderer_settings.highp_threshold_min = 2048;
775 cc::SurfaceManager* manager = GetSurfaceManager(); 775 cc::SurfaceManager* manager = GetSurfaceManager();
776 auto* task_runner = base::ThreadTaskRunnerHandle::Get().get(); 776 auto* task_runner = base::ThreadTaskRunnerHandle::Get().get();
777 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( 777 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler(
778 task_runner, display_output_surface->capabilities().max_frames_pending)); 778 task_runner, display_output_surface->capabilities().max_frames_pending));
779 779
780 display_.reset(new cc::Display( 780 display_.reset(new cc::Display(
781 viz::HostSharedBitmapManager::current(), 781 viz::HostSharedBitmapManager::current(),
782 BrowserGpuMemoryBufferManager::current(), 782 BrowserGpuMemoryBufferManager::current(), renderer_settings,
783 host_->GetSettings().renderer_settings, frame_sink_id_, 783 frame_sink_id_, root_window_->GetBeginFrameSource(),
784 root_window_->GetBeginFrameSource(), std::move(display_output_surface), 784 std::move(display_output_surface), std::move(scheduler),
785 std::move(scheduler),
786 base::MakeUnique<cc::TextureMailboxDeleter>(task_runner))); 785 base::MakeUnique<cc::TextureMailboxDeleter>(task_runner)));
787 786
788 auto compositor_frame_sink = 787 auto compositor_frame_sink =
789 vulkan_context_provider 788 vulkan_context_provider
790 ? base::MakeUnique<cc::DirectCompositorFrameSink>( 789 ? base::MakeUnique<cc::DirectCompositorFrameSink>(
791 frame_sink_id_, manager, display_.get(), 790 frame_sink_id_, manager, display_.get(),
792 vulkan_context_provider) 791 vulkan_context_provider)
793 : base::MakeUnique<cc::DirectCompositorFrameSink>( 792 : base::MakeUnique<cc::DirectCompositorFrameSink>(
794 frame_sink_id_, manager, display_.get(), context_provider, 793 frame_sink_id_, manager, display_.get(), context_provider,
795 nullptr, BrowserGpuMemoryBufferManager::current(), 794 nullptr, BrowserGpuMemoryBufferManager::current(),
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 } 880 }
882 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_, 881 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_,
883 frame_sink_id); 882 frame_sink_id);
884 } 883 }
885 884
886 bool CompositorImpl::HavePendingReadbacks() { 885 bool CompositorImpl::HavePendingReadbacks() {
887 return !readback_layer_tree_->children().empty(); 886 return !readback_layer_tree_->children().empty();
888 } 887 }
889 888
890 } // namespace content 889 } // namespace content
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_settings.h ('k') | content/renderer/gpu/render_widget_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698