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 25 matching lines...) Expand all Loading... |
36 using WebKit::WebPoint; | 36 using WebKit::WebPoint; |
37 using WebKit::WebRect; | 37 using WebKit::WebRect; |
38 using WebKit::WebSize; | 38 using WebKit::WebSize; |
39 using WebKit::WebString; | 39 using WebKit::WebString; |
40 using WebKit::WebTextDirection; | 40 using WebKit::WebTextDirection; |
41 using WebKit::WebTextInputType; | 41 using WebKit::WebTextInputType; |
42 using WebKit::WebVector; | 42 using WebKit::WebVector; |
43 using WebKit::WebWidget; | 43 using WebKit::WebWidget; |
44 using WebKit::WGC3Dintptr; | 44 using WebKit::WGC3Dintptr; |
45 | 45 |
| 46 namespace content { |
| 47 |
46 namespace { | 48 namespace { |
47 | 49 |
48 // See third_party/WebKit/Source/WebCore/dom/WheelEvent.h. | 50 // See third_party/WebKit/Source/WebCore/dom/WheelEvent.h. |
49 const float kTickDivisor = 120.0f; | 51 const float kTickDivisor = 120.0f; |
50 | 52 |
51 class FullscreenMouseLockDispatcher : public MouseLockDispatcher { | 53 class FullscreenMouseLockDispatcher : public MouseLockDispatcher { |
52 public: | 54 public: |
53 explicit FullscreenMouseLockDispatcher(RenderWidgetFullscreenPepper* widget); | 55 explicit FullscreenMouseLockDispatcher(RenderWidgetFullscreenPepper* widget); |
54 virtual ~FullscreenMouseLockDispatcher(); | 56 virtual ~FullscreenMouseLockDispatcher(); |
55 | 57 |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 } | 430 } |
429 | 431 |
430 void RenderWidgetFullscreenPepper::DidChangeCursor( | 432 void RenderWidgetFullscreenPepper::DidChangeCursor( |
431 const WebKit::WebCursorInfo& cursor) { | 433 const WebKit::WebCursorInfo& cursor) { |
432 didChangeCursor(cursor); | 434 didChangeCursor(cursor); |
433 } | 435 } |
434 | 436 |
435 webkit::ppapi::PluginDelegate::PlatformContext3D* | 437 webkit::ppapi::PluginDelegate::PlatformContext3D* |
436 RenderWidgetFullscreenPepper::CreateContext3D() { | 438 RenderWidgetFullscreenPepper::CreateContext3D() { |
437 #ifdef ENABLE_GPU | 439 #ifdef ENABLE_GPU |
438 return new content::PlatformContext3DImpl(this); | 440 return new PlatformContext3DImpl(this); |
439 #else | 441 #else |
440 return NULL; | 442 return NULL; |
441 #endif | 443 #endif |
442 } | 444 } |
443 | 445 |
444 void RenderWidgetFullscreenPepper::ReparentContext( | 446 void RenderWidgetFullscreenPepper::ReparentContext( |
445 webkit::ppapi::PluginDelegate::PlatformContext3D* context) { | 447 webkit::ppapi::PluginDelegate::PlatformContext3D* context) { |
446 static_cast<content::PlatformContext3DImpl*>(context)->SetParentContext(this); | 448 static_cast<PlatformContext3DImpl*>(context)->SetParentContext(this); |
447 } | 449 } |
448 | 450 |
449 MouseLockDispatcher* RenderWidgetFullscreenPepper::GetMouseLockDispatcher() { | 451 MouseLockDispatcher* RenderWidgetFullscreenPepper::GetMouseLockDispatcher() { |
450 return mouse_lock_dispatcher_.get(); | 452 return mouse_lock_dispatcher_.get(); |
451 } | 453 } |
452 | 454 |
453 bool RenderWidgetFullscreenPepper::OnMessageReceived(const IPC::Message& msg) { | 455 bool RenderWidgetFullscreenPepper::OnMessageReceived(const IPC::Message& msg) { |
454 bool handled = true; | 456 bool handled = true; |
455 IPC_BEGIN_MESSAGE_MAP(RenderWidgetFullscreenPepper, msg) | 457 IPC_BEGIN_MESSAGE_MAP(RenderWidgetFullscreenPepper, msg) |
456 IPC_MESSAGE_FORWARD(ViewMsg_LockMouse_ACK, | 458 IPC_MESSAGE_FORWARD(ViewMsg_LockMouse_ACK, |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 attributes.stencil = false; | 537 attributes.stencil = false; |
536 attributes.antialias = false; | 538 attributes.antialias = false; |
537 attributes.shareResources = false; | 539 attributes.shareResources = false; |
538 context_ = WebGraphicsContext3DCommandBufferImpl::CreateViewContext( | 540 context_ = WebGraphicsContext3DCommandBufferImpl::CreateViewContext( |
539 RenderThreadImpl::current(), | 541 RenderThreadImpl::current(), |
540 surface_id(), | 542 surface_id(), |
541 NULL, | 543 NULL, |
542 attributes, | 544 attributes, |
543 true /* bind generates resources */, | 545 true /* bind generates resources */, |
544 active_url_, | 546 active_url_, |
545 content::CAUSE_FOR_GPU_LAUNCH_RENDERWIDGETFULLSCREENPEPPER_CREATECONTEXT); | 547 CAUSE_FOR_GPU_LAUNCH_RENDERWIDGETFULLSCREENPEPPER_CREATECONTEXT); |
546 if (!context_) | 548 if (!context_) |
547 return; | 549 return; |
548 | 550 |
549 if (!InitContext()) { | 551 if (!InitContext()) { |
550 DestroyContext(context_, program_, buffer_); | 552 DestroyContext(context_, program_, buffer_); |
551 context_ = NULL; | 553 context_ = NULL; |
552 return; | 554 return; |
553 } | 555 } |
554 } | 556 } |
555 | 557 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 | 675 |
674 WebGraphicsContext3DCommandBufferImpl* | 676 WebGraphicsContext3DCommandBufferImpl* |
675 RenderWidgetFullscreenPepper::GetParentContextForPlatformContext3D() { | 677 RenderWidgetFullscreenPepper::GetParentContextForPlatformContext3D() { |
676 if (!context_) { | 678 if (!context_) { |
677 CreateContext(); | 679 CreateContext(); |
678 } | 680 } |
679 if (!context_) | 681 if (!context_) |
680 return NULL; | 682 return NULL; |
681 return context_; | 683 return context_; |
682 } | 684 } |
| 685 |
| 686 } // namespace content |
OLD | NEW |