| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/webplugin_delegate_proxy.h" | 5 #include "content/renderer/webplugin_delegate_proxy.h" |
| 6 | 6 |
| 7 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 if (!uses_shared_bitmaps_) | 718 if (!uses_shared_bitmaps_) |
| 719 return; | 719 return; |
| 720 | 720 |
| 721 // We got a paint before the plugin's coordinates, so there's no buffer to | 721 // We got a paint before the plugin's coordinates, so there's no buffer to |
| 722 // copy from. | 722 // copy from. |
| 723 if (!backing_store_canvas_.get()) | 723 if (!backing_store_canvas_.get()) |
| 724 return; | 724 return; |
| 725 | 725 |
| 726 // We're using the native OS APIs from here on out. | 726 // We're using the native OS APIs from here on out. |
| 727 #if WEBKIT_USING_SKIA | 727 #if WEBKIT_USING_SKIA |
| 728 gfx::NativeDrawingContext context = canvas->beginPlatformPaint(); | 728 gfx::NativeDrawingContext context = skia::BeginPlatformPaint(canvas); |
| 729 #elif WEBKIT_USING_CG | 729 #elif WEBKIT_USING_CG |
| 730 gfx::NativeDrawingContext context = canvas; | 730 gfx::NativeDrawingContext context = canvas; |
| 731 #endif | 731 #endif |
| 732 | 732 |
| 733 gfx::Rect offset_rect = rect; | 733 gfx::Rect offset_rect = rect; |
| 734 offset_rect.Offset(-plugin_rect_.x(), -plugin_rect_.y()); | 734 offset_rect.Offset(-plugin_rect_.x(), -plugin_rect_.y()); |
| 735 gfx::Rect canvas_rect = offset_rect; | 735 gfx::Rect canvas_rect = offset_rect; |
| 736 #if defined(OS_MACOSX) | 736 #if defined(OS_MACOSX) |
| 737 // The canvases are flipped relative to the context, so flip the rect too. | 737 // The canvases are flipped relative to the context, so flip the rect too. |
| 738 FlipRectVerticallyWithHeight(&canvas_rect, plugin_rect_.height()); | 738 FlipRectVerticallyWithHeight(&canvas_rect, plugin_rect_.height()); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 756 | 756 |
| 757 if (invalidate_pending_) { | 757 if (invalidate_pending_) { |
| 758 // Only send the PaintAck message if this paint is in response to an | 758 // Only send the PaintAck message if this paint is in response to an |
| 759 // invalidate from the plugin, since this message acts as an access token | 759 // invalidate from the plugin, since this message acts as an access token |
| 760 // to ensure only one process is using the transport dib at a time. | 760 // to ensure only one process is using the transport dib at a time. |
| 761 invalidate_pending_ = false; | 761 invalidate_pending_ = false; |
| 762 Send(new PluginMsg_DidPaint(instance_id_)); | 762 Send(new PluginMsg_DidPaint(instance_id_)); |
| 763 } | 763 } |
| 764 | 764 |
| 765 #if WEBKIT_USING_SKIA | 765 #if WEBKIT_USING_SKIA |
| 766 canvas->endPlatformPaint(); | 766 skia::EndPlatformPaint(canvas); |
| 767 #endif | 767 #endif |
| 768 } | 768 } |
| 769 | 769 |
| 770 bool WebPluginDelegateProxy::BackgroundChanged( | 770 bool WebPluginDelegateProxy::BackgroundChanged( |
| 771 gfx::NativeDrawingContext context, | 771 gfx::NativeDrawingContext context, |
| 772 const gfx::Rect& rect) { | 772 const gfx::Rect& rect) { |
| 773 #if defined(OS_WIN) | 773 #if defined(OS_WIN) |
| 774 HBITMAP hbitmap = static_cast<HBITMAP>(GetCurrentObject(context, OBJ_BITMAP)); | 774 HBITMAP hbitmap = static_cast<HBITMAP>(GetCurrentObject(context, OBJ_BITMAP)); |
| 775 if (hbitmap == NULL) { | 775 if (hbitmap == NULL) { |
| 776 NOTREACHED(); | 776 NOTREACHED(); |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1388 } | 1388 } |
| 1389 #endif | 1389 #endif |
| 1390 | 1390 |
| 1391 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, | 1391 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, |
| 1392 int resource_id) { | 1392 int resource_id) { |
| 1393 if (!plugin_) | 1393 if (!plugin_) |
| 1394 return; | 1394 return; |
| 1395 | 1395 |
| 1396 plugin_->URLRedirectResponse(allow, resource_id); | 1396 plugin_->URLRedirectResponse(allow, resource_id); |
| 1397 } | 1397 } |
| OLD | NEW |