| 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 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2184 } | 2186 } |
| 2185 | 2187 |
| 2186 float RenderWidget::GetOriginalDeviceScaleFactor() const { | 2188 float RenderWidget::GetOriginalDeviceScaleFactor() const { |
| 2187 return | 2189 return |
| 2188 screen_metrics_emulator_ ? | 2190 screen_metrics_emulator_ ? |
| 2189 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : | 2191 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : |
| 2190 device_scale_factor_; | 2192 device_scale_factor_; |
| 2191 } | 2193 } |
| 2192 | 2194 |
| 2193 } // namespace content | 2195 } // namespace content |
| OLD | NEW |