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 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1429 void RenderWidget::initializeLayerTreeView() { | 1429 void RenderWidget::initializeLayerTreeView() { |
1430 compositor_ = RenderWidgetCompositor::Create(this); | 1430 compositor_ = RenderWidgetCompositor::Create(this); |
1431 if (!compositor_) | 1431 if (!compositor_) |
1432 return; | 1432 return; |
1433 | 1433 |
1434 compositor_->setViewportSize(size_, physical_backing_size_); | 1434 compositor_->setViewportSize(size_, physical_backing_size_); |
1435 if (init_complete_) | 1435 if (init_complete_) |
1436 compositor_->setSurfaceReady(); | 1436 compositor_->setSurfaceReady(); |
1437 } | 1437 } |
1438 | 1438 |
1439 void RenderWidget::initializeLayerTreeView( | |
1440 WebKit::WebLayerTreeViewClient* client, | |
1441 const WebKit::WebLayer& root_layer, | |
1442 const WebKit::WebLayerTreeView::Settings& settings) { | |
1443 initializeLayerTreeView(); | |
1444 if (compositor_) | |
1445 compositor_->setRootLayer(root_layer); | |
1446 } | |
1447 | |
1448 WebKit::WebLayerTreeView* RenderWidget::layerTreeView() { | 1439 WebKit::WebLayerTreeView* RenderWidget::layerTreeView() { |
1449 return compositor_.get(); | 1440 return compositor_.get(); |
1450 } | 1441 } |
1451 | 1442 |
1452 void RenderWidget::suppressCompositorScheduling(bool enable) { | 1443 void RenderWidget::suppressCompositorScheduling(bool enable) { |
1453 if (compositor_) | 1444 if (compositor_) |
1454 compositor_->SetSuppressScheduleComposite(enable); | 1445 compositor_->SetSuppressScheduleComposite(enable); |
1455 } | 1446 } |
1456 | 1447 |
1457 void RenderWidget::willBeginCompositorFrame() { | 1448 void RenderWidget::willBeginCompositorFrame() { |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2276 if (!context->Initialize( | 2267 if (!context->Initialize( |
2277 attributes, | 2268 attributes, |
2278 false /* bind generates resources */, | 2269 false /* bind generates resources */, |
2279 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZ
E)) | 2270 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZ
E)) |
2280 return NULL; | 2271 return NULL; |
2281 return context.release(); | 2272 return context.release(); |
2282 } | 2273 } |
2283 } | 2274 } |
2284 | 2275 |
2285 } // namespace content | 2276 } // namespace content |
OLD | NEW |