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

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

Issue 675083002: Add cc::RendererSettings for use in with cc::Display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 (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 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 display_client_.reset(); 404 display_client_.reset();
405 if (current_composite_task_) { 405 if (current_composite_task_) {
406 current_composite_task_->Cancel(); 406 current_composite_task_->Cancel();
407 current_composite_task_.reset(); 407 current_composite_task_.reset();
408 } 408 }
409 } else if (!host_) { 409 } else if (!host_) {
410 DCHECK(!WillComposite()); 410 DCHECK(!WillComposite());
411 needs_composite_ = false; 411 needs_composite_ = false;
412 pending_swapbuffers_ = 0; 412 pending_swapbuffers_ = 0;
413 cc::LayerTreeSettings settings; 413 cc::LayerTreeSettings settings;
414 settings.refresh_rate = 60.0; 414 settings.renderer_settings.refresh_rate = 60.0;
415 settings.renderer_settings.allow_antialiasing = false;
416 settings.renderer_settings.highp_threshold_min = 2048;
415 settings.impl_side_painting = false; 417 settings.impl_side_painting = false;
416 settings.allow_antialiasing = false;
417 settings.calculate_top_controls_position = false; 418 settings.calculate_top_controls_position = false;
418 settings.top_controls_height = 0.f; 419 settings.top_controls_height = 0.f;
419 settings.highp_threshold_min = 2048;
420 420
421 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 421 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
422 settings.initial_debug_state.SetRecordRenderingStats( 422 settings.initial_debug_state.SetRecordRenderingStats(
423 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); 423 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking));
424 settings.initial_debug_state.show_fps_counter = 424 settings.initial_debug_state.show_fps_counter =
425 command_line->HasSwitch(cc::switches::kUIShowFPSCounter); 425 command_line->HasSwitch(cc::switches::kUIShowFPSCounter);
426 // TODO(enne): Update this this compositor to use the scheduler. 426 // TODO(enne): Update this this compositor to use the scheduler.
427 settings.single_thread_proxy_scheduler = false; 427 settings.single_thread_proxy_scheduler = false;
428 428
429 host_ = cc::LayerTreeHost::CreateSingleThreaded( 429 host_ = cc::LayerTreeHost::CreateSingleThreaded(
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 } 556 }
557 557
558 scoped_ptr<cc::OutputSurface> real_output_surface( 558 scoped_ptr<cc::OutputSurface> real_output_surface(
559 new OutputSurfaceWithoutParent(context_provider, 559 new OutputSurfaceWithoutParent(context_provider,
560 weak_factory_.GetWeakPtr())); 560 weak_factory_.GetWeakPtr()));
561 561
562 cc::SurfaceManager* manager = GetSurfaceManager(); 562 cc::SurfaceManager* manager = GetSurfaceManager();
563 if (manager) { 563 if (manager) {
564 display_client_.reset( 564 display_client_.reset(
565 new OnscreenDisplayClient(real_output_surface.Pass(), manager, 565 new OnscreenDisplayClient(real_output_surface.Pass(), manager,
566 host_->settings().renderer_settings,
566 base::MessageLoopProxy::current())); 567 base::MessageLoopProxy::current()));
567 scoped_ptr<SurfaceDisplayOutputSurface> surface_output_surface( 568 scoped_ptr<SurfaceDisplayOutputSurface> surface_output_surface(
568 new SurfaceDisplayOutputSurface(manager, surface_id_allocator_.get(), 569 new SurfaceDisplayOutputSurface(manager, surface_id_allocator_.get(),
569 context_provider)); 570 context_provider));
570 571
571 display_client_->set_surface_output_surface(surface_output_surface.get()); 572 display_client_->set_surface_output_surface(surface_output_surface.get());
572 surface_output_surface->set_display_client(display_client_.get()); 573 surface_output_surface->set_display_client(display_client_.get());
573 host_->SetOutputSurface(surface_output_surface.Pass()); 574 host_->SetOutputSurface(surface_output_surface.Pass());
574 } else { 575 } else {
575 host_->SetOutputSurface(real_output_surface.Pass()); 576 host_->SetOutputSurface(real_output_surface.Pass());
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 } 670 }
670 671
671 void CompositorImpl::SetNeedsAnimate() { 672 void CompositorImpl::SetNeedsAnimate() {
672 if (!host_) 673 if (!host_)
673 return; 674 return;
674 675
675 host_->SetNeedsAnimate(); 676 host_->SetNeedsAnimate();
676 } 677 }
677 678
678 } // namespace content 679 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/compositor/onscreen_display_client.cc ('k') | content/renderer/gpu/render_widget_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698