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

Side by Side Diff: content/renderer/render_widget.cc

Issue 1769913003: sync compositor: Add output_surface_id (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nit in test Created 4 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 | « content/renderer/android/synchronous_compositor_proxy.cc ('k') | 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 (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/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 worker_context_provider = 745 worker_context_provider =
746 RenderThreadImpl::current()->SharedWorkerContextProvider(); 746 RenderThreadImpl::current()->SharedWorkerContextProvider();
747 if (!worker_context_provider) { 747 if (!worker_context_provider) {
748 // Cause the compositor to wait and try again. 748 // Cause the compositor to wait and try again.
749 return nullptr; 749 return nullptr;
750 } 750 }
751 751
752 #if defined(OS_ANDROID) 752 #if defined(OS_ANDROID)
753 if (SynchronousCompositorFactory* factory = 753 if (SynchronousCompositorFactory* factory =
754 SynchronousCompositorFactory::GetInstance()) { 754 SynchronousCompositorFactory::GetInstance()) {
755 uint32_t output_surface_id = next_output_surface_id_++;
755 return factory->CreateOutputSurface( 756 return factory->CreateOutputSurface(
756 routing_id(), frame_swap_message_queue_, context_provider, 757 routing_id(), output_surface_id, frame_swap_message_queue_,
757 worker_context_provider); 758 context_provider, worker_context_provider);
758 } else if (RenderThreadImpl::current()->sync_compositor_message_filter()) { 759 } else if (RenderThreadImpl::current()->sync_compositor_message_filter()) {
760 uint32_t output_surface_id = next_output_surface_id_++;
759 return make_scoped_ptr(new SynchronousCompositorOutputSurface( 761 return make_scoped_ptr(new SynchronousCompositorOutputSurface(
760 context_provider, worker_context_provider, routing_id(), 762 context_provider, worker_context_provider, routing_id(),
761 content::RenderThreadImpl::current() 763 output_surface_id, content::RenderThreadImpl::current()
762 ->sync_compositor_message_filter(), 764 ->sync_compositor_message_filter(),
763 frame_swap_message_queue_)); 765 frame_swap_message_queue_));
764 } 766 }
765 #endif 767 #endif
766 } 768 }
767 769
768 uint32_t output_surface_id = next_output_surface_id_++; 770 uint32_t output_surface_id = next_output_surface_id_++;
769 // Composite-to-mailbox is currently used for layout tests in order to cause 771 // Composite-to-mailbox is currently used for layout tests in order to cause
770 // them to draw inside in the renderer to do the readback there. This should 772 // them to draw inside in the renderer to do the readback there. This should
771 // no longer be the case when crbug.com/311404 is fixed. 773 // no longer be the case when crbug.com/311404 is fixed.
772 if (!RenderThreadImpl::current() || 774 if (!RenderThreadImpl::current() ||
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after
2149 } 2151 }
2150 2152
2151 float RenderWidget::GetOriginalDeviceScaleFactor() const { 2153 float RenderWidget::GetOriginalDeviceScaleFactor() const {
2152 return 2154 return
2153 screen_metrics_emulator_ ? 2155 screen_metrics_emulator_ ?
2154 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : 2156 screen_metrics_emulator_->original_screen_info().deviceScaleFactor :
2155 device_scale_factor_; 2157 device_scale_factor_;
2156 } 2158 }
2157 2159
2158 } // namespace content 2160 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/android/synchronous_compositor_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698