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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 16831004: Perform glReadPixels with PBOs in the gpu, if PBOs are available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use webglid where approperiate Created 7 years, 6 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/common/gpu/gpu_command_buffer_stub.cc
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index eb8904e3881f8c5c9527c60f16e057b9e798c364..d6706af571aae3d8c7e3ab0d4e5639932e59256a 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -29,6 +29,7 @@
#include "gpu/command_buffer/service/gl_state_restorer_impl.h"
#include "gpu/command_buffer/service/logger.h"
#include "gpu/command_buffer/service/memory_tracking.h"
+#include "gpu/command_buffer/service/query_manager.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_switches.h"
@@ -210,6 +211,8 @@ bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
OnRetireSyncPoint)
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalSyncPoint,
OnSignalSyncPoint)
+ IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalQuery,
+ OnSignalQuery)
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SendClientManagedMemoryStats,
OnReceivedClientManagedMemoryStats)
IPC_MESSAGE_HANDLER(
@@ -814,6 +817,26 @@ void GpuCommandBufferStub::OnSignalSyncPointAck(uint32 id) {
Send(new GpuCommandBufferMsg_SignalSyncPointAck(route_id_, id));
}
+void GpuCommandBufferStub::OnSignalQuery(uint32 query_id, uint32 id) {
+ if (decoder_) {
+ gpu::gles2::QueryManager* query_manager = decoder_->GetQueryManager();
+ if (query_manager) {
+ gpu::gles2::QueryManager::Query* query =
+ query_manager->GetQuery(query_id);
+ if (query) {
+ query->AddCallback(
+ base::Bind(&GpuCommandBufferStub::OnSignalSyncPointAck,
+ this->AsWeakPtr(),
+ id));
+ return;
+ }
+ }
+ }
+ // Something went wrong, run callback immediately.
+ OnSignalSyncPointAck(id);
+}
+
+
void GpuCommandBufferStub::OnReceivedClientManagedMemoryStats(
const GpuManagedMemoryStats& stats) {
TRACE_EVENT0(

Powered by Google App Engine
This is Rietveld 408576698