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

Unified Diff: gpu/command_buffer/service/valuebuffer_manager.cc

Issue 634313002: Add mouse input forwarding to gpu service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add Security Test 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
Index: gpu/command_buffer/service/valuebuffer_manager.cc
diff --git a/gpu/command_buffer/service/valuebuffer_manager.cc b/gpu/command_buffer/service/valuebuffer_manager.cc
index eb4db093f70211d15af73cc3531979480ae6d33d..0edac1da3d65ada180aa902bd6980bb356cddee8 100644
--- a/gpu/command_buffer/service/valuebuffer_manager.cc
+++ b/gpu/command_buffer/service/valuebuffer_manager.cc
@@ -3,13 +3,14 @@
// found in the LICENSE file.
#include "gpu/command_buffer/service/valuebuffer_manager.h"
+#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/command_buffer/service/program_manager.h"
namespace gpu {
namespace gles2 {
-Valuebuffer::Valuebuffer(ValuebufferManager* manager, GLuint client_id)
+Valuebuffer::Valuebuffer(ValuebufferManager* manager, unsigned int client_id)
: manager_(manager), client_id_(client_id), has_been_bound_(false) {
manager_->StartTracking(this);
}
@@ -21,19 +22,19 @@ Valuebuffer::~Valuebuffer() {
}
}
-void Valuebuffer::AddSubscription(GLenum subscription) {
+void Valuebuffer::AddSubscription(unsigned int subscription) {
subscriptions_.insert(subscription);
}
-void Valuebuffer::RemoveSubscription(GLenum subscription) {
+void Valuebuffer::RemoveSubscription(unsigned int subscription) {
subscriptions_.erase(subscription);
}
-bool Valuebuffer::IsSubscribed(GLenum subscription) {
+bool Valuebuffer::IsSubscribed(unsigned int subscription) {
return subscriptions_.find(subscription) != subscriptions_.end();
}
-const ValueState *Valuebuffer::GetState(GLenum target) const {
+const ValueState *Valuebuffer::GetState(unsigned int target) const {
StateMap::const_iterator it = active_state_map_.find(target);
return it != active_state_map_.end() ? &it->second : NULL;
}
@@ -53,18 +54,13 @@ ValuebufferManager::ValuebufferManager()
}
ValuebufferManager::~ValuebufferManager() {
- DCHECK(valuebuffer_map_.empty());
- DCHECK(pending_state_map_.empty());
+ valuebuffer_map_.clear();
+ pending_state_map_.clear();
// If this triggers, that means something is keeping a reference to
// a Valuebuffer belonging to this.
CHECK_EQ(valuebuffer_count_, 0u);
}
-void ValuebufferManager::Destroy() {
- valuebuffer_map_.clear();
- pending_state_map_.clear();
-}
-
void ValuebufferManager::StartTracking(Valuebuffer* /* valuebuffer */) {
++valuebuffer_count_;
}
@@ -73,19 +69,19 @@ void ValuebufferManager::StopTracking(Valuebuffer* /* valuebuffer */) {
--valuebuffer_count_;
}
-void ValuebufferManager::CreateValuebuffer(GLuint client_id) {
+void ValuebufferManager::CreateValuebuffer(unsigned int client_id) {
scoped_refptr<Valuebuffer> valuebuffer(new Valuebuffer(this, client_id));
std::pair<ValuebufferMap::iterator, bool> result =
valuebuffer_map_.insert(std::make_pair(client_id, valuebuffer));
DCHECK(result.second);
}
-Valuebuffer* ValuebufferManager::GetValuebuffer(GLuint client_id) {
+Valuebuffer* ValuebufferManager::GetValuebuffer(unsigned int client_id) {
ValuebufferMap::iterator it = valuebuffer_map_.find(client_id);
return it != valuebuffer_map_.end() ? it->second.get() : NULL;
}
-void ValuebufferManager::RemoveValuebuffer(GLuint client_id) {
+void ValuebufferManager::RemoveValuebuffer(unsigned int client_id) {
ValuebufferMap::iterator it = valuebuffer_map_.find(client_id);
if (it != valuebuffer_map_.end()) {
Valuebuffer* valuebuffer = it->second.get();
@@ -104,7 +100,13 @@ void ValuebufferManager::UpdateValueState(
pending_state_map_[target] = state;
}
-uint32 ValuebufferManager::ApiTypeForSubscriptionTarget(GLenum target) {
+const ValueState *ValuebufferManager::GetPendingState(
piman 2014/11/26 20:47:09 nit: star on the left.
orglofch 2014/12/01 01:54:29 Done. Removed, no longer needed for testing.
+ unsigned int target) const {
+ Valuebuffer::StateMap::const_iterator it = pending_state_map_.find(target);
+ return it != pending_state_map_.end() ? &it->second : NULL;
+}
+
+uint32 ValuebufferManager::ApiTypeForSubscriptionTarget(unsigned int target) {
switch (target) {
case GL_MOUSE_POSITION_CHROMIUM:
return Program::kUniform2i;

Powered by Google App Engine
This is Rietveld 408576698