| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1791 } | 1791 } |
| 1792 } | 1792 } |
| 1793 | 1793 |
| 1794 void RenderWidget::AutoResizeCompositor() { | 1794 void RenderWidget::AutoResizeCompositor() { |
| 1795 physical_backing_size_ = gfx::ToCeiledSize(gfx::ScaleSize(size_, | 1795 physical_backing_size_ = gfx::ToCeiledSize(gfx::ScaleSize(size_, |
| 1796 device_scale_factor_)); | 1796 device_scale_factor_)); |
| 1797 if (compositor_) | 1797 if (compositor_) |
| 1798 compositor_->setViewportSize(size_, physical_backing_size_); | 1798 compositor_->setViewportSize(size_, physical_backing_size_); |
| 1799 } | 1799 } |
| 1800 | 1800 |
| 1801 void RenderWidget::didActivateCompositor(int input_handler_identifier) { | 1801 void RenderWidget::didActivateCompositor() { |
| 1802 TRACE_EVENT0("gpu", "RenderWidget::didActivateCompositor"); | 1802 TRACE_EVENT0("gpu", "RenderWidget::didActivateCompositor"); |
| 1803 | 1803 |
| 1804 #if !defined(OS_MACOSX) | 1804 #if !defined(OS_MACOSX) |
| 1805 if (!is_accelerated_compositing_active_) { | 1805 if (!is_accelerated_compositing_active_) { |
| 1806 // When not in accelerated compositing mode, in certain cases (e.g. waiting | 1806 // When not in accelerated compositing mode, in certain cases (e.g. waiting |
| 1807 // for a resize or if no backing store) the RenderWidgetHost is blocking the | 1807 // for a resize or if no backing store) the RenderWidgetHost is blocking the |
| 1808 // browser's UI thread for some time, waiting for an UpdateRect. If we are | 1808 // browser's UI thread for some time, waiting for an UpdateRect. If we are |
| 1809 // going to switch to accelerated compositing, the GPU process may need | 1809 // going to switch to accelerated compositing, the GPU process may need |
| 1810 // round-trips to the browser's UI thread before finishing the frame, | 1810 // round-trips to the browser's UI thread before finishing the frame, |
| 1811 // causing deadlocks if we delay the UpdateRect until we receive the | 1811 // causing deadlocks if we delay the UpdateRect until we receive the |
| (...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2862 surface_id(), | 2862 surface_id(), |
| 2863 GetURLForGraphicsContext3D(), | 2863 GetURLForGraphicsContext3D(), |
| 2864 gpu_channel_host.get(), | 2864 gpu_channel_host.get(), |
| 2865 attributes, | 2865 attributes, |
| 2866 false /* bind generates resources */, | 2866 false /* bind generates resources */, |
| 2867 limits)); | 2867 limits)); |
| 2868 return context.Pass(); | 2868 return context.Pass(); |
| 2869 } | 2869 } |
| 2870 | 2870 |
| 2871 } // namespace content | 2871 } // namespace content |
| OLD | NEW |