| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #define PEPPER_APIS_ENABLED 1 | 5 #define PEPPER_APIS_ENABLED 1 |
| 6 | 6 |
| 7 #include "chrome/renderer/webplugin_delegate_pepper.h" | 7 #include "chrome/renderer/webplugin_delegate_pepper.h" |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 WebPluginDelegatePepper::~WebPluginDelegatePepper() { | 586 WebPluginDelegatePepper::~WebPluginDelegatePepper() { |
| 587 DestroyInstance(); | 587 DestroyInstance(); |
| 588 } | 588 } |
| 589 | 589 |
| 590 void WebPluginDelegatePepper::PluginDestroyed() { | 590 void WebPluginDelegatePepper::PluginDestroyed() { |
| 591 delete this; | 591 delete this; |
| 592 } | 592 } |
| 593 | 593 |
| 594 void WebPluginDelegatePepper::Paint(WebKit::WebCanvas* canvas, | 594 void WebPluginDelegatePepper::Paint(WebKit::WebCanvas* canvas, |
| 595 const gfx::Rect& rect) { | 595 const gfx::Rect& rect) { |
| 596 #if defined(OS_WIN) | 596 #if defined(OS_WIN) || defined(OS_LINUX) |
| 597 if (nested_delegate_) { | 597 if (nested_delegate_) { |
| 598 // TODO(apatrick): The GPU plugin will render to an offscreen render target. | 598 // TODO(apatrick): The GPU plugin will render to an offscreen render target. |
| 599 // Need to copy it to the screen here. | 599 // Need to copy it to the screen here. |
| 600 } else { | 600 } else { |
| 601 // Blit from background_context to context. | 601 // Blit from background_context to context. |
| 602 if (!committed_bitmap_.isNull()) { | 602 if (!committed_bitmap_.isNull()) { |
| 603 gfx::Point origin(window_rect_.origin().x(), window_rect_.origin().y()); | 603 gfx::Point origin(window_rect_.origin().x(), window_rect_.origin().y()); |
| 604 canvas->drawBitmap(committed_bitmap_, | 604 canvas->drawBitmap(committed_bitmap_, |
| 605 SkIntToScalar(window_rect_.origin().x()), | 605 SkIntToScalar(window_rect_.origin().x()), |
| 606 SkIntToScalar(window_rect_.origin().y())); | 606 SkIntToScalar(window_rect_.origin().y())); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 BuildCharEvent(&event, &npevent); | 731 BuildCharEvent(&event, &npevent); |
| 732 break; | 732 break; |
| 733 case NPEventType_Minimize: | 733 case NPEventType_Minimize: |
| 734 case NPEventType_Focus: | 734 case NPEventType_Focus: |
| 735 case NPEventType_Device: | 735 case NPEventType_Device: |
| 736 // NOTIMPLEMENTED(); | 736 // NOTIMPLEMENTED(); |
| 737 break; | 737 break; |
| 738 } | 738 } |
| 739 return instance()->NPP_HandleEvent(&npevent) != 0; | 739 return instance()->NPP_HandleEvent(&npevent) != 0; |
| 740 } | 740 } |
| OLD | NEW |