| OLD | NEW |
| 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 Loading... |
| 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_++; |
| 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() || |
| (...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |