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

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 | skia/ext/platform_canvas.h » ('j') | skia/ext/platform_canvas.h » ('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 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | skia/ext/platform_canvas.h » ('j') | skia/ext/platform_canvas.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698