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

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: rebase 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
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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 CreateGraphicsContext3D(gpu_channel_host.get()), 742 CreateGraphicsContext3D(gpu_channel_host.get()),
743 RENDER_COMPOSITOR_CONTEXT); 743 RENDER_COMPOSITOR_CONTEXT);
744 DCHECK(context_provider); 744 DCHECK(context_provider);
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 uint32_t output_surface_id = next_output_surface_id_++;
752 #if defined(OS_ANDROID) 753 #if defined(OS_ANDROID)
753 if (SynchronousCompositorFactory* factory = 754 if (SynchronousCompositorFactory* factory =
754 SynchronousCompositorFactory::GetInstance()) { 755 SynchronousCompositorFactory::GetInstance()) {
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()) {
759 return make_scoped_ptr(new SynchronousCompositorOutputSurface( 760 return make_scoped_ptr(new SynchronousCompositorOutputSurface(
760 context_provider, worker_context_provider, routing_id(), 761 context_provider, worker_context_provider, routing_id(),
761 content::RenderThreadImpl::current() 762 output_surface_id, content::RenderThreadImpl::current()
762 ->sync_compositor_message_filter(), 763 ->sync_compositor_message_filter(),
763 frame_swap_message_queue_)); 764 frame_swap_message_queue_));
764 } 765 }
765 #endif 766 #endif
766 } 767 }
767 768
768 uint32_t output_surface_id = next_output_surface_id_++; 769 uint32_t output_surface_id = next_output_surface_id_++;
no sievers 2016/03/18 20:03:13 you forgot to remove this line.
boliu 2016/03/19 00:18:16 Actually the one added above is guarded by !use_so
769 // Composite-to-mailbox is currently used for layout tests in order to cause 770 // 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 771 // 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. 772 // no longer be the case when crbug.com/311404 is fixed.
772 if (!RenderThreadImpl::current() || 773 if (!RenderThreadImpl::current() ||
773 !RenderThreadImpl::current()->layout_test_mode()) { 774 !RenderThreadImpl::current()->layout_test_mode()) {
774 DCHECK(compositor_deps_->GetCompositorImplThreadTaskRunner()); 775 DCHECK(compositor_deps_->GetCompositorImplThreadTaskRunner());
775 return make_scoped_ptr(new DelegatedCompositorOutputSurface( 776 return make_scoped_ptr(new DelegatedCompositorOutputSurface(
776 routing_id(), output_surface_id, context_provider, 777 routing_id(), output_surface_id, context_provider,
777 worker_context_provider, frame_swap_message_queue_)); 778 worker_context_provider, frame_swap_message_queue_));
778 } 779 }
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after
2184 } 2185 }
2185 2186
2186 float RenderWidget::GetOriginalDeviceScaleFactor() const { 2187 float RenderWidget::GetOriginalDeviceScaleFactor() const {
2187 return 2188 return
2188 screen_metrics_emulator_ ? 2189 screen_metrics_emulator_ ?
2189 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : 2190 screen_metrics_emulator_->original_screen_info().deviceScaleFactor :
2190 device_scale_factor_; 2191 device_scale_factor_;
2191 } 2192 }
2192 2193
2193 } // namespace content 2194 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698