Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Side by Side Diff: content/renderer/render_widget.cc

Issue 12472015: Add implementation of WebWidgetClient::initializeLayerTreeView() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: null check compositor_, initialization can fail Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 using_asynchronous_swapbuffers_ = false; 1355 using_asynchronous_swapbuffers_ = false;
1356 1356
1357 // In single-threaded mode, we exit force compositing mode and re-enter in 1357 // In single-threaded mode, we exit force compositing mode and re-enter in
1358 // DoDeferredUpdate() if appropriate. In threaded compositing mode, 1358 // DoDeferredUpdate() if appropriate. In threaded compositing mode,
1359 // DoDeferredUpdate() is bypassed and WebKit is responsible for exiting and 1359 // DoDeferredUpdate() is bypassed and WebKit is responsible for exiting and
1360 // entering force compositing mode at the appropriate times. 1360 // entering force compositing mode at the appropriate times.
1361 if (!is_threaded_compositing_enabled_) 1361 if (!is_threaded_compositing_enabled_)
1362 webwidget_->enterForceCompositingMode(false); 1362 webwidget_->enterForceCompositingMode(false);
1363 } 1363 }
1364 1364
1365 void RenderWidget::initializeLayerTreeView() {
1366 compositor_ = RenderWidgetCompositor::Create(this);
1367 if (!compositor_)
1368 return;
1369
1370 compositor_->setViewportSize(size_, physical_backing_size_);
1371 if (init_complete_)
1372 compositor_->setSurfaceReady();
1373 }
1374
1365 void RenderWidget::initializeLayerTreeView( 1375 void RenderWidget::initializeLayerTreeView(
1366 WebKit::WebLayerTreeViewClient* client, 1376 WebKit::WebLayerTreeViewClient* client,
1367 const WebKit::WebLayer& root_layer, 1377 const WebKit::WebLayer& root_layer,
1368 const WebKit::WebLayerTreeView::Settings& settings) { 1378 const WebKit::WebLayerTreeView::Settings& settings) {
1369 compositor_ = RenderWidgetCompositor::Create(this, settings); 1379 initializeLayerTreeView();
1370 if (!compositor_) 1380 if (compositor_)
1371 return; 1381 compositor_->setRootLayer(root_layer);
1372
1373 compositor_->setRootLayer(root_layer);
1374 compositor_->setViewportSize(size_, physical_backing_size_);
1375 if (init_complete_)
1376 compositor_->setSurfaceReady();
1377 } 1382 }
1378 1383
1379 WebKit::WebLayerTreeView* RenderWidget::layerTreeView() { 1384 WebKit::WebLayerTreeView* RenderWidget::layerTreeView() {
1380 return compositor_.get(); 1385 return compositor_.get();
1381 } 1386 }
1382 1387
1383 void RenderWidget::suppressCompositorScheduling(bool enable) { 1388 void RenderWidget::suppressCompositorScheduling(bool enable) {
1384 if (compositor_) 1389 if (compositor_)
1385 compositor_->SetSuppressScheduleComposite(enable); 1390 compositor_->SetSuppressScheduleComposite(enable);
1386 } 1391 }
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
2180 bool RenderWidget::WillHandleGestureEvent( 2185 bool RenderWidget::WillHandleGestureEvent(
2181 const WebKit::WebGestureEvent& event) { 2186 const WebKit::WebGestureEvent& event) {
2182 return false; 2187 return false;
2183 } 2188 }
2184 2189
2185 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const { 2190 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const {
2186 return true; 2191 return true;
2187 } 2192 }
2188 2193
2189 } // namespace content 2194 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698