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

Unified Diff: content/renderer/pepper/resource_creation_impl.cc

Issue 727073002: Plugin Power Saver: Force SW rendering for peripheral plugins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0192-plugin-power-saver-implement-basic-stop-frame-heuristic
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/pepper/resource_creation_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « content/renderer/pepper/resource_creation_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698