Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: content/renderer/webplugin_delegate_proxy.cc

Issue 6783023: Eliminate skia::PlatformCanvas - Step 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/gfx/native_theme_win.h » ('j') | webkit/glue/webthemeengine_impl_win.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 skia::PlatformCanvas* platform_canvas =
729 static_cast<skia::PlatformCanvas*>(canvas);
730 gfx::NativeDrawingContext context = platform_canvas->beginPlatformPaint();
729 #elif WEBKIT_USING_CG 731 #elif WEBKIT_USING_CG
730 gfx::NativeDrawingContext context = canvas; 732 gfx::NativeDrawingContext context = canvas;
731 #endif 733 #endif
732 734
733 gfx::Rect offset_rect = rect; 735 gfx::Rect offset_rect = rect;
734 offset_rect.Offset(-plugin_rect_.x(), -plugin_rect_.y()); 736 offset_rect.Offset(-plugin_rect_.x(), -plugin_rect_.y());
735 gfx::Rect canvas_rect = offset_rect; 737 gfx::Rect canvas_rect = offset_rect;
736 #if defined(OS_MACOSX) 738 #if defined(OS_MACOSX)
737 // The canvases are flipped relative to the context, so flip the rect too. 739 // The canvases are flipped relative to the context, so flip the rect too.
738 FlipRectVerticallyWithHeight(&canvas_rect, plugin_rect_.height()); 740 FlipRectVerticallyWithHeight(&canvas_rect, plugin_rect_.height());
(...skipping 17 matching lines...) Expand all
756 758
757 if (invalidate_pending_) { 759 if (invalidate_pending_) {
758 // Only send the PaintAck message if this paint is in response to an 760 // 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 761 // 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. 762 // to ensure only one process is using the transport dib at a time.
761 invalidate_pending_ = false; 763 invalidate_pending_ = false;
762 Send(new PluginMsg_DidPaint(instance_id_)); 764 Send(new PluginMsg_DidPaint(instance_id_));
763 } 765 }
764 766
765 #if WEBKIT_USING_SKIA 767 #if WEBKIT_USING_SKIA
766 canvas->endPlatformPaint(); 768 platform_canvas->endPlatformPaint();
767 #endif 769 #endif
768 } 770 }
769 771
770 bool WebPluginDelegateProxy::BackgroundChanged( 772 bool WebPluginDelegateProxy::BackgroundChanged(
771 gfx::NativeDrawingContext context, 773 gfx::NativeDrawingContext context,
772 const gfx::Rect& rect) { 774 const gfx::Rect& rect) {
773 #if defined(OS_WIN) 775 #if defined(OS_WIN)
774 HBITMAP hbitmap = static_cast<HBITMAP>(GetCurrentObject(context, OBJ_BITMAP)); 776 HBITMAP hbitmap = static_cast<HBITMAP>(GetCurrentObject(context, OBJ_BITMAP));
775 if (hbitmap == NULL) { 777 if (hbitmap == NULL) {
776 NOTREACHED(); 778 NOTREACHED();
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 } 1390 }
1389 #endif 1391 #endif
1390 1392
1391 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, 1393 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow,
1392 int resource_id) { 1394 int resource_id) {
1393 if (!plugin_) 1395 if (!plugin_)
1394 return; 1396 return;
1395 1397
1396 plugin_->URLRedirectResponse(allow, resource_id); 1398 plugin_->URLRedirectResponse(allow, resource_id);
1397 } 1399 }
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/native_theme_win.h » ('j') | webkit/glue/webthemeengine_impl_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698