| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "third_party/WebKit/public/platform/WebString.h" | 50 #include "third_party/WebKit/public/platform/WebString.h" |
| 51 #include "third_party/WebKit/public/web/WebCursorInfo.h" | 51 #include "third_party/WebKit/public/web/WebCursorInfo.h" |
| 52 #include "third_party/WebKit/public/web/WebHelperPlugin.h" | 52 #include "third_party/WebKit/public/web/WebHelperPlugin.h" |
| 53 #include "third_party/WebKit/public/web/WebPagePopup.h" | 53 #include "third_party/WebKit/public/web/WebPagePopup.h" |
| 54 #include "third_party/WebKit/public/web/WebPopupMenu.h" | 54 #include "third_party/WebKit/public/web/WebPopupMenu.h" |
| 55 #include "third_party/WebKit/public/web/WebPopupMenuInfo.h" | 55 #include "third_party/WebKit/public/web/WebPopupMenuInfo.h" |
| 56 #include "third_party/WebKit/public/web/WebRange.h" | 56 #include "third_party/WebKit/public/web/WebRange.h" |
| 57 #include "third_party/WebKit/public/web/WebScreenInfo.h" | 57 #include "third_party/WebKit/public/web/WebScreenInfo.h" |
| 58 #include "third_party/skia/include/core/SkShader.h" | 58 #include "third_party/skia/include/core/SkShader.h" |
| 59 #include "ui/base/ui_base_switches.h" | 59 #include "ui/base/ui_base_switches.h" |
| 60 #include "ui/gfx/frame_time.h" |
| 60 #include "ui/gfx/rect_conversions.h" | 61 #include "ui/gfx/rect_conversions.h" |
| 61 #include "ui/gfx/size_conversions.h" | 62 #include "ui/gfx/size_conversions.h" |
| 62 #include "ui/gfx/skia_util.h" | 63 #include "ui/gfx/skia_util.h" |
| 63 #include "ui/gl/gl_switches.h" | 64 #include "ui/gl/gl_switches.h" |
| 64 #include "ui/surface/transport_dib.h" | 65 #include "ui/surface/transport_dib.h" |
| 65 #include "webkit/renderer/compositor_bindings/web_rendering_stats_impl.h" | 66 #include "webkit/renderer/compositor_bindings/web_rendering_stats_impl.h" |
| 66 | 67 |
| 67 #if defined(OS_ANDROID) | 68 #if defined(OS_ANDROID) |
| 68 #include "base/android/sys_utils.h" | 69 #include "base/android/sys_utils.h" |
| 69 #include "content/renderer/android/synchronous_compositor_factory.h" | 70 #include "content/renderer/android/synchronous_compositor_factory.h" |
| (...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1436 | 1437 |
| 1437 // Suppress updating when we are hidden. | 1438 // Suppress updating when we are hidden. |
| 1438 if (is_hidden_ || size_.IsEmpty() || is_swapped_out_) { | 1439 if (is_hidden_ || size_.IsEmpty() || is_swapped_out_) { |
| 1439 paint_aggregator_.ClearPendingUpdate(); | 1440 paint_aggregator_.ClearPendingUpdate(); |
| 1440 needs_repainting_on_restore_ = true; | 1441 needs_repainting_on_restore_ = true; |
| 1441 TRACE_EVENT0("renderer", "EarlyOut_NotVisible"); | 1442 TRACE_EVENT0("renderer", "EarlyOut_NotVisible"); |
| 1442 return; | 1443 return; |
| 1443 } | 1444 } |
| 1444 | 1445 |
| 1445 // Tracking of frame rate jitter | 1446 // Tracking of frame rate jitter |
| 1446 base::TimeTicks frame_begin_ticks = base::TimeTicks::Now(); | 1447 base::TimeTicks frame_begin_ticks = gfx::FrameTime::Now(); |
| 1447 InstrumentWillBeginFrame(); | 1448 InstrumentWillBeginFrame(); |
| 1448 AnimateIfNeeded(); | 1449 AnimateIfNeeded(); |
| 1449 | 1450 |
| 1450 // Layout may generate more invalidation. It may also enable the | 1451 // Layout may generate more invalidation. It may also enable the |
| 1451 // GPU acceleration, so make sure to run layout before we send the | 1452 // GPU acceleration, so make sure to run layout before we send the |
| 1452 // GpuRenderingActivated message. | 1453 // GpuRenderingActivated message. |
| 1453 webwidget_->layout(); | 1454 webwidget_->layout(); |
| 1454 | 1455 |
| 1455 // Check for whether we need to track swap buffers. We need to do that after | 1456 // Check for whether we need to track swap buffers. We need to do that after |
| 1456 // layout() because it may have switched us to accelerated compositing. | 1457 // layout() because it may have switched us to accelerated compositing. |
| (...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2818 GetURLForGraphicsContext3D(), | 2819 GetURLForGraphicsContext3D(), |
| 2819 gpu_channel_host.get(), | 2820 gpu_channel_host.get(), |
| 2820 swap_client, | 2821 swap_client, |
| 2821 attributes, | 2822 attributes, |
| 2822 false /* bind generates resources */, | 2823 false /* bind generates resources */, |
| 2823 limits)); | 2824 limits)); |
| 2824 return context.Pass(); | 2825 return context.Pass(); |
| 2825 } | 2826 } |
| 2826 | 2827 |
| 2827 } // namespace content | 2828 } // namespace content |
| OLD | NEW |