summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/pepper_plugin_delegate_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/renderer/pepper_plugin_delegate_impl.cc')
-rw-r--r--chrome/renderer/pepper_plugin_delegate_impl.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/renderer/pepper_plugin_delegate_impl.cc b/chrome/renderer/pepper_plugin_delegate_impl.cc
index 40ef961..bc11d6c 100644
--- a/chrome/renderer/pepper_plugin_delegate_impl.cc
+++ b/chrome/renderer/pepper_plugin_delegate_impl.cc
@@ -7,6 +7,7 @@
#include "app/surface/transport_dib.h"
#include "base/scoped_ptr.h"
#include "webkit/glue/plugins/pepper_plugin_instance.h"
+#include "webkit/glue/webkit_glue.h"
#if defined(OS_MACOSX)
#include "chrome/common/render_messages.h"
@@ -131,3 +132,16 @@ PepperPluginDelegateImpl::CreateImage2D(int width, int height) {
return new PlatformImage2DImpl(width, height, dib);
}
+
+bool PepperPluginDelegateImpl::OptimizedPluginPaintInRect(
+ skia::PlatformCanvas* canvas,
+ const gfx::Rect& rect) {
+ for (std::set<pepper::PluginInstance*>::iterator i = active_instances_.begin();
+ i != active_instances_.end(); ++i) {
+ if ((*i)->position().Contains(rect)) {
+ (*i)->Paint(webkit_glue::ToWebCanvas(canvas), (*i)->position(), rect);
+ return true;
+ }
+ }
+ return false;
+}