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_fullscreen_pepper.h" | 5 #include "content/renderer/render_widget_fullscreen_pepper.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
317 Release(); | 317 Release(); |
318 } | 318 } |
319 | 319 |
320 void RenderWidgetFullscreenPepper::DidChangeCursor( | 320 void RenderWidgetFullscreenPepper::DidChangeCursor( |
321 const blink::WebCursorInfo& cursor) { | 321 const blink::WebCursorInfo& cursor) { |
322 didChangeCursor(cursor); | 322 didChangeCursor(cursor); |
323 } | 323 } |
324 | 324 |
325 void RenderWidgetFullscreenPepper::SetLayer(blink::WebLayer* layer) { | 325 void RenderWidgetFullscreenPepper::SetLayer(blink::WebLayer* layer) { |
326 layer_ = layer; | 326 layer_ = layer; |
327 bool compositing = !!layer_; | 327 if (!layer_) |
danakj
2014/05/14 15:03:34
Should we setRootLayer(NULL) if !layer_? Before we
enne (OOO)
2014/05/15 20:51:15
Sure. I think that seems reasonable, although I t
| |
328 if (compositing != is_accelerated_compositing_active_) { | 328 return; |
329 if (compositing) { | 329 if (!layerTreeView()) |
330 if (!layerTreeView()) | 330 initializeLayerTreeView(); |
331 initializeLayerTreeView(); | 331 if (!layerTreeView()) |
danakj
2014/05/14 15:03:34
Can this go away too?
enne (OOO)
2014/05/15 20:51:15
Done.
| |
332 if (!layerTreeView()) | 332 return; |
333 return; | 333 layer_->setBounds(blink::WebSize(size())); |
334 layer_->setBounds(blink::WebSize(size())); | 334 layer_->setDrawsContent(true); |
335 layer_->setDrawsContent(true); | 335 compositor_->setDeviceScaleFactor(device_scale_factor_); |
336 compositor_->setDeviceScaleFactor(device_scale_factor_); | 336 compositor_->setRootLayer(*layer_); |
337 compositor_->setRootLayer(*layer_); | |
338 didActivateCompositor(); | |
339 } else { | |
340 didDeactivateCompositor(); | |
341 } | |
342 } | |
343 } | 337 } |
344 | 338 |
345 bool RenderWidgetFullscreenPepper::OnMessageReceived(const IPC::Message& msg) { | 339 bool RenderWidgetFullscreenPepper::OnMessageReceived(const IPC::Message& msg) { |
346 bool handled = true; | 340 bool handled = true; |
347 IPC_BEGIN_MESSAGE_MAP(RenderWidgetFullscreenPepper, msg) | 341 IPC_BEGIN_MESSAGE_MAP(RenderWidgetFullscreenPepper, msg) |
348 IPC_MESSAGE_FORWARD(ViewMsg_LockMouse_ACK, | 342 IPC_MESSAGE_FORWARD(ViewMsg_LockMouse_ACK, |
349 mouse_lock_dispatcher_.get(), | 343 mouse_lock_dispatcher_.get(), |
350 MouseLockDispatcher::OnLockMouseACK) | 344 MouseLockDispatcher::OnLockMouseACK) |
351 IPC_MESSAGE_FORWARD(ViewMsg_MouseLockLost, | 345 IPC_MESSAGE_FORWARD(ViewMsg_MouseLockLost, |
352 mouse_lock_dispatcher_.get(), | 346 mouse_lock_dispatcher_.get(), |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
395 } | 389 } |
396 | 390 |
397 void RenderWidgetFullscreenPepper::SetDeviceScaleFactor( | 391 void RenderWidgetFullscreenPepper::SetDeviceScaleFactor( |
398 float device_scale_factor) { | 392 float device_scale_factor) { |
399 RenderWidget::SetDeviceScaleFactor(device_scale_factor); | 393 RenderWidget::SetDeviceScaleFactor(device_scale_factor); |
400 if (compositor_) | 394 if (compositor_) |
401 compositor_->setDeviceScaleFactor(device_scale_factor); | 395 compositor_->setDeviceScaleFactor(device_scale_factor); |
402 } | 396 } |
403 | 397 |
404 } // namespace content | 398 } // namespace content |
OLD | NEW |