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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 | 399 |
400 Send(new ViewHostMsg_Close(routing_id_)); | 400 Send(new ViewHostMsg_Close(routing_id_)); |
401 Release(); | 401 Release(); |
402 } | 402 } |
403 | 403 |
404 void RenderWidgetFullscreenPepper::DidChangeCursor( | 404 void RenderWidgetFullscreenPepper::DidChangeCursor( |
405 const WebKit::WebCursorInfo& cursor) { | 405 const WebKit::WebCursorInfo& cursor) { |
406 didChangeCursor(cursor); | 406 didChangeCursor(cursor); |
407 } | 407 } |
408 | 408 |
409 webkit::ppapi::PluginDelegate::PlatformContext3D* | |
410 RenderWidgetFullscreenPepper::CreateContext3D() { | |
411 CommandLine* command_line = CommandLine::ForCurrentProcess(); | |
412 if (command_line->HasSwitch(switches::kDisableFlashFullscreen3d)) | |
413 return NULL; | |
414 return new PlatformContext3DImpl; | |
415 } | |
416 | |
417 void RenderWidgetFullscreenPepper::ReparentContext( | |
418 webkit::ppapi::PluginDelegate::PlatformContext3D* context) { | |
419 PlatformContext3DImpl* context_impl = | |
420 static_cast<PlatformContext3DImpl*>(context); | |
421 | |
422 CommandLine* command_line = CommandLine::ForCurrentProcess(); | |
423 if (command_line->HasSwitch(switches::kDisableFlashFullscreen3d)) | |
424 context_impl->DestroyParentContextProviderAndBackingTexture(); | |
425 else | |
426 context_impl->SetParentAndCreateBackingTextureIfNeeded(); | |
427 } | |
428 | |
429 void RenderWidgetFullscreenPepper::SetLayer(WebKit::WebLayer* layer) { | 409 void RenderWidgetFullscreenPepper::SetLayer(WebKit::WebLayer* layer) { |
430 layer_ = layer; | 410 layer_ = layer; |
431 bool compositing = !!layer_; | 411 bool compositing = !!layer_; |
432 if (compositing != is_accelerated_compositing_active_) { | 412 if (compositing != is_accelerated_compositing_active_) { |
433 if (compositing) { | 413 if (compositing) { |
434 initializeLayerTreeView(); | 414 initializeLayerTreeView(); |
435 if (!layerTreeView()) | 415 if (!layerTreeView()) |
436 return; | 416 return; |
437 layer_->setBounds(WebKit::WebSize(size())); | 417 layer_->setBounds(WebKit::WebSize(size())); |
438 layer_->setDrawsContent(true); | 418 layer_->setDrawsContent(true); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 } | 497 } |
518 | 498 |
519 void RenderWidgetFullscreenPepper::SetDeviceScaleFactor( | 499 void RenderWidgetFullscreenPepper::SetDeviceScaleFactor( |
520 float device_scale_factor) { | 500 float device_scale_factor) { |
521 RenderWidget::SetDeviceScaleFactor(device_scale_factor); | 501 RenderWidget::SetDeviceScaleFactor(device_scale_factor); |
522 if (compositor_) | 502 if (compositor_) |
523 compositor_->setDeviceScaleFactor(device_scale_factor); | 503 compositor_->setDeviceScaleFactor(device_scale_factor); |
524 } | 504 } |
525 | 505 |
526 } // namespace content | 506 } // namespace content |
OLD | NEW |