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/webplugin_delegate_proxy.h" | 5 #include "content/renderer/webplugin_delegate_proxy.h" |
6 | 6 |
7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #elif defined(USE_X11) | 9 #elif defined(USE_X11) |
10 #include <cairo/cairo.h> | 10 #include <cairo/cairo.h> |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 | 696 |
697 if (!uses_shared_bitmaps_) | 697 if (!uses_shared_bitmaps_) |
698 return; | 698 return; |
699 | 699 |
700 // We got a paint before the plugin's coordinates, so there's no buffer to | 700 // We got a paint before the plugin's coordinates, so there's no buffer to |
701 // copy from. | 701 // copy from. |
702 if (!front_buffer_canvas()) | 702 if (!front_buffer_canvas()) |
703 return; | 703 return; |
704 | 704 |
705 // We're using the native OS APIs from here on out. | 705 // We're using the native OS APIs from here on out. |
706 #if WEBKIT_USING_SKIA | |
707 if (!skia::SupportsPlatformPaint(canvas)) { | 706 if (!skia::SupportsPlatformPaint(canvas)) { |
708 // TODO(alokp): Implement this path. | 707 // TODO(alokp): Implement this path. |
709 // This block will only get hit with --enable-accelerated-drawing flag. | 708 // This block will only get hit with --enable-accelerated-drawing flag. |
710 // With accelerated canvas, we do not have a bitmap that can be provided | 709 // With accelerated canvas, we do not have a bitmap that can be provided |
711 // to the plugin for compositing. We may have to implement a solution | 710 // to the plugin for compositing. We may have to implement a solution |
712 // described in crbug.com/12586. | 711 // described in crbug.com/12586. |
713 DLOG(WARNING) << "Could not paint plugin"; | 712 DLOG(WARNING) << "Could not paint plugin"; |
714 return; | 713 return; |
715 } | 714 } |
716 skia::ScopedPlatformPaint scoped_platform_paint(canvas); | 715 skia::ScopedPlatformPaint scoped_platform_paint(canvas); |
717 gfx::NativeDrawingContext context = | 716 gfx::NativeDrawingContext context = |
718 scoped_platform_paint.GetPlatformSurface(); | 717 scoped_platform_paint.GetPlatformSurface(); |
719 #elif WEBKIT_USING_CG | |
720 gfx::NativeDrawingContext context = canvas; | |
721 #endif | |
722 | 718 |
723 gfx::Rect offset_rect = rect; | 719 gfx::Rect offset_rect = rect; |
724 offset_rect.Offset(-plugin_rect_.x(), -plugin_rect_.y()); | 720 offset_rect.Offset(-plugin_rect_.x(), -plugin_rect_.y()); |
725 gfx::Rect canvas_rect = offset_rect; | 721 gfx::Rect canvas_rect = offset_rect; |
726 #if defined(OS_MACOSX) | 722 #if defined(OS_MACOSX) |
727 // The canvases are flipped relative to the context, so flip the rect too. | 723 // The canvases are flipped relative to the context, so flip the rect too. |
728 FlipRectVerticallyWithHeight(&canvas_rect, plugin_rect_.height()); | 724 FlipRectVerticallyWithHeight(&canvas_rect, plugin_rect_.height()); |
729 #endif | 725 #endif |
730 | 726 |
731 bool background_changed = false; | 727 bool background_changed = false; |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1473 } | 1469 } |
1474 #endif | 1470 #endif |
1475 | 1471 |
1476 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, | 1472 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, |
1477 int resource_id) { | 1473 int resource_id) { |
1478 if (!plugin_) | 1474 if (!plugin_) |
1479 return; | 1475 return; |
1480 | 1476 |
1481 plugin_->URLRedirectResponse(allow, resource_id); | 1477 plugin_->URLRedirectResponse(allow, resource_id); |
1482 } | 1478 } |
OLD | NEW |