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

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

Issue 2317363005: Add basic GL functionality to the passthrough command buffer. (Closed)
Patch Set: Created 4 years, 3 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: gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
index f3a19dc7527d93446ccadc38cbbb9e8ac4fbca2c..d921ac3542c0c171358f961370a413f00cd49834 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
@@ -11,6 +11,10 @@
namespace gpu {
namespace gles2 {
+PassthroughResources::PassthroughResources() {}
+
+PassthroughResources::~PassthroughResources() {}
+
GLES2DecoderPassthroughImpl::GLES2DecoderPassthroughImpl(ContextGroup* group)
: commands_to_process_(0),
debug_marker_manager_(),
@@ -113,6 +117,17 @@ bool GLES2DecoderPassthroughImpl::Initialize(
image_manager_.reset(new ImageManager());
+ resources_ = group_->passthrough_resources();
+
+ mailbox_manager_ = group_->mailbox_manager();
+
+ // Query information about the texture units
+ GLint num_texture_units = 0;
+ glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &num_texture_units);
+
+ active_texture_unit_ = 0;
+ bound_textures_.resize(num_texture_units, 0);
+
set_initialized();
return true;
}
@@ -175,11 +190,11 @@ gl::GLContext* GLES2DecoderPassthroughImpl::GetGLContext() {
}
gpu::gles2::ContextGroup* GLES2DecoderPassthroughImpl::GetContextGroup() {
- return nullptr;
+ return group_.get();
}
const FeatureInfo* GLES2DecoderPassthroughImpl::GetFeatureInfo() const {
- return nullptr;
+ return group_->feature_info();
}
gpu::Capabilities GLES2DecoderPassthroughImpl::GetCapabilities() {
@@ -294,10 +309,14 @@ size_t GLES2DecoderPassthroughImpl::GetCreatedBackTextureCountForTest() {
}
void GLES2DecoderPassthroughImpl::SetFenceSyncReleaseCallback(
- const FenceSyncReleaseCallback& callback) {}
+ const FenceSyncReleaseCallback& callback) {
+ fence_sync_release_callback_ = callback;
+}
void GLES2DecoderPassthroughImpl::SetWaitFenceSyncCallback(
- const WaitFenceSyncCallback& callback) {}
+ const WaitFenceSyncCallback& callback) {
+ wait_fence_sync_callback_ = callback;
+}
void GLES2DecoderPassthroughImpl::SetDescheduleUntilFinishedCallback(
const NoParamCallback& callback) {}
@@ -344,7 +363,8 @@ void GLES2DecoderPassthroughImpl::PerformPollingWork() {}
bool GLES2DecoderPassthroughImpl::GetServiceTextureId(
uint32_t client_texture_id,
uint32_t* service_texture_id) {
- return false;
+ return resources_->texture_id_map.GetServiceID(client_texture_id,
+ service_texture_id);
}
gpu::error::ContextLostReason

Powered by Google App Engine
This is Rietveld 408576698