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

Unified Diff: content/renderer/pepper/pepper_plugin_instance_impl.h

Issue 1912833002: Pepper takes ownership of a mailbox before passing it to the texture layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from bbudge. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper/pepper_plugin_instance_impl.h
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.h b/content/renderer/pepper/pepper_plugin_instance_impl.h
index da461798a5502d85b77b040a6e0bbc80c3ec0cb0..315381f011fd06e226866b1f32200a6e7aa8f6d8 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.h
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.h
@@ -24,6 +24,7 @@
#include "cc/layers/content_layer_client.h"
#include "cc/layers/layer.h"
#include "cc/layers/texture_layer_client.h"
+#include "cc/resources/texture_mailbox.h"
#include "content/common/content_export.h"
#include "content/public/renderer/pepper_plugin_instance.h"
#include "content/public/renderer/plugin_instance_throttler.h"
@@ -197,9 +198,17 @@ class CONTENT_EXPORT PepperPluginInstanceImpl
// slow path can also be triggered if there is an overlapping frame.
void ScrollRect(int dx, int dy, const gfx::Rect& rect);
- // Commit the backing texture to the screen once the side effects some
- // rendering up to an offscreen SwapBuffers are visible.
- void CommitBackingTexture();
+ // Commit the texture mailbox to the screen.
+ void CommitTextureMailbox(const cc::TextureMailbox& texture_mailbox);
+
+ // Passes the committed texture to |texture_layer_| and marks it as in use.
+ void PassCommittedTextureToTextureLayer();
+
+ // Callback when the compositor is finished consuming the committed texture.
+ void FinishedConsumingCommittedTexture(
+ const cc::TextureMailbox& texture_mailbox,
+ const gpu::SyncToken& sync_token,
+ bool is_lost);
// Called when the out-of-process plugin implementing this instance crashed.
void InstanceCrashed();
@@ -933,6 +942,16 @@ class CONTENT_EXPORT PepperPluginInstanceImpl
// The text that is currently selected in the plugin.
base::string16 selected_text_;
+ // The most recently committed texture. This is kept around in case the layer
+ // needs to be regenerated.
+ cc::TextureMailbox committed_texture_;
+
+ // Whether the most recently committed texture is still in use by the
+ // compositor.
+ bool committed_texture_in_use_ = false;
+
+ gpu::SyncToken committed_texture_consumed_sync_token_;
+
bool initialized_;
// We use a weak ptr factory for scheduling DidChangeView events so that we
« no previous file with comments | « components/mus/public/interfaces/command_buffer.mojom ('k') | content/renderer/pepper/pepper_plugin_instance_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698