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

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

Issue 10915065: Add PlatformPictureSkia and RecordingPlatformDeviceSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add IsPlatformPaintSupported(), update comment in WebPluginDelegateProxy::Paint and require direct … Created 8 years, 2 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
OLDNEW
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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 750
751 if (!uses_shared_bitmaps_) 751 if (!uses_shared_bitmaps_)
752 return; 752 return;
753 753
754 // We got a paint before the plugin's coordinates, so there's no buffer to 754 // We got a paint before the plugin's coordinates, so there's no buffer to
755 // copy from. 755 // copy from.
756 if (!front_buffer_canvas()) 756 if (!front_buffer_canvas())
757 return; 757 return;
758 758
759 // We're using the native OS APIs from here on out. 759 // We're using the native OS APIs from here on out.
760 if (!skia::SupportsPlatformPaint(canvas)) { 760 if (!skia::IsPlatformPaintSupported(canvas)) {
761 // TODO(alokp): Implement this path. 761 // This block will only get hit when we do not have a bitmap that can be
762 // This block will only get hit with --enable-accelerated-drawing flag. 762 // provided to the plugin for compositing.
763 // With accelerated canvas, we do not have a bitmap that can be provided
764 // to the plugin for compositing. We may have to implement a solution
765 // described in crbug.com/12586.
766 DLOG(WARNING) << "Could not paint plugin"; 763 DLOG(WARNING) << "Could not paint plugin";
767 return; 764 return;
768 } 765 }
769 skia::ScopedPlatformPaint scoped_platform_paint(canvas); 766 skia::ScopedPlatformPaint scoped_platform_paint(canvas);
770 gfx::NativeDrawingContext context = 767 gfx::NativeDrawingContext context =
771 scoped_platform_paint.GetPlatformSurface(); 768 scoped_platform_paint.GetPlatformSurface();
772 769
773 gfx::Rect offset_rect = rect; 770 gfx::Rect offset_rect = rect;
774 offset_rect.Offset(-plugin_rect_.x(), -plugin_rect_.y()); 771 offset_rect.Offset(-plugin_rect_.x(), -plugin_rect_.y());
775 gfx::Rect canvas_rect = offset_rect; 772 gfx::Rect canvas_rect = offset_rect;
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 } 1524 }
1528 #endif 1525 #endif
1529 1526
1530 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, 1527 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow,
1531 int resource_id) { 1528 int resource_id) {
1532 if (!plugin_) 1529 if (!plugin_)
1533 return; 1530 return;
1534 1531
1535 plugin_->URLRedirectResponse(allow, resource_id); 1532 plugin_->URLRedirectResponse(allow, resource_id);
1536 } 1533 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698