Index: content/renderer/pepper/resource_creation_impl.cc |
diff --git a/content/renderer/pepper/resource_creation_impl.cc b/content/renderer/pepper/resource_creation_impl.cc |
index 4a693256ae0bed669f87885196139e1d6d3c2e70..841cba20b44de949b29396d91657484d44945701 100644 |
--- a/content/renderer/pepper/resource_creation_impl.cc |
+++ b/content/renderer/pepper/resource_creation_impl.cc |
@@ -4,6 +4,8 @@ |
#include "content/renderer/pepper/resource_creation_impl.h" |
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
+#include "content/renderer/pepper/pepper_plugin_instance_throttler.h" |
#include "content/renderer/pepper/ppb_audio_impl.h" |
#include "content/renderer/pepper/ppb_broker_impl.h" |
#include "content/renderer/pepper/ppb_buffer_impl.h" |
@@ -33,7 +35,8 @@ using ppapi::StringVar; |
namespace content { |
-ResourceCreationImpl::ResourceCreationImpl(PepperPluginInstanceImpl* instance) { |
+ResourceCreationImpl::ResourceCreationImpl(PepperPluginInstanceImpl* instance) |
+ : instance_(instance) { |
} |
ResourceCreationImpl::~ResourceCreationImpl() {} |
@@ -106,6 +109,10 @@ PP_Resource ResourceCreationImpl::CreateFlashMessageLoop(PP_Instance instance) { |
PP_Resource ResourceCreationImpl::CreateGraphics3D(PP_Instance instance, |
PP_Resource share_context, |
const int32_t* attrib_list) { |
+ // Force SW rendering for keyframe extraction to avoid pixel reads from VRAM. |
groby-ooo-7-16
2014/11/14 22:45:39
I'm curious: ResourceCreationImpl has essentially
piman
2014/11/14 22:53:00
Yes, this logic should go to PPB_Graphics3D_Impl::
tommycli
2014/11/14 23:58:21
Done.
tommycli
2014/11/14 23:58:21
Done.
|
+ if (instance_->throttler() && instance_->throttler()->needs_snapshot()) |
+ return 0; |
+ |
return PPB_Graphics3D_Impl::Create(instance, share_context, attrib_list); |
} |
@@ -115,6 +122,10 @@ PP_Resource ResourceCreationImpl::CreateGraphics3DRaw( |
const int32_t* attrib_list, |
gpu::Capabilities* capabilities, |
base::SharedMemoryHandle* shared_state) { |
+ // Force SW rendering for keyframe extraction to avoid pixel reads from VRAM. |
+ if (instance_->throttler() && instance_->throttler()->needs_snapshot()) |
+ return 0; |
+ |
return PPB_Graphics3D_Impl::CreateRaw(instance, share_context, attrib_list, |
capabilities, shared_state); |
} |