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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.h

Issue 780133002: Add optimization for CHROMIUM_subscribe_uniform extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: piman@ review Created 6 years 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/browser/renderer_host/render_widget_host_impl.h
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 454bb17ffbbd957e0e77150b51ac82c0f9b7048f..3207028f08a69178f77172c2f5bc70027beb725e 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -61,6 +61,11 @@ namespace gfx {
class Range;
}
+namespace gpu {
+union ValueState;
+class ValueStateMap;
+}
+
namespace ui {
class KeyEvent;
}
@@ -473,6 +478,10 @@ class CONTENT_EXPORT RenderWidgetHostImpl
InputRouter* input_router() { return input_router_.get(); }
+ // Handlers for subscription target changes to update subscription_set_
+ void OnAddSubscription(unsigned int target);
+ void OnRemoveSubscription(unsigned int target);
+
// Get the BrowserAccessibilityManager for the root of the frame tree,
BrowserAccessibilityManager* GetRootBrowserAccessibilityManager();
@@ -697,6 +706,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
int snapshot_id,
scoped_refptr<base::RefCountedBytes> png_data);
+ void SendUpdateValueState(unsigned int target, const gpu::ValueState& state);
+
// Our delegate, which wants to know mainly about keyboard events.
// It will remain non-NULL until DetachDelegate() is called.
RenderWidgetHostDelegate* delegate_;
@@ -849,6 +860,17 @@ class CONTENT_EXPORT RenderWidgetHostImpl
base::Callback<void(const unsigned char*, size_t)> > PendingSnapshotMap;
PendingSnapshotMap pending_browser_snapshots_;
+ // This is a set of all subscription targets valuebuffers in the GPU process
+ // are currently subscribed too. Used to prevent sending unnecessary
+ // ValueState updates.
+ typedef base::hash_set<unsigned int> SubscriptionSet;
+ SubscriptionSet subscription_set_;
+
+ // Maintains ValueStates which are not currently subscribed too so we can
+ // pass them to the GpuService if a Valuebuffer ever subscribes to the
+ // respective subscription target
+ scoped_refptr<gpu::ValueStateMap> pending_valuebuffer_state_;
+
base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);

Powered by Google App Engine
This is Rietveld 408576698