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

Side by Side Diff: components/mus/gles2/command_buffer_driver.cc

Issue 2061743004: Implement native GMB backbuffers in the GLES2 Command Decoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from piman. Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | gpu/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/mus/gles2/command_buffer_driver.h" 5 #include "components/mus/gles2/command_buffer_driver.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 return false; 123 return false;
124 124
125 if (!context_->MakeCurrent(surface_.get())) 125 if (!context_->MakeCurrent(surface_.get()))
126 return false; 126 return false;
127 127
128 // TODO(piman): ShaderTranslatorCache is currently per-ContextGroup but 128 // TODO(piman): ShaderTranslatorCache is currently per-ContextGroup but
129 // only needs to be per-thread. 129 // only needs to be per-thread.
130 const bool bind_generates_resource = attrib_helper.bind_generates_resource; 130 const bool bind_generates_resource = attrib_helper.bind_generates_resource;
131 scoped_refptr<gpu::gles2::FeatureInfo> feature_info = 131 scoped_refptr<gpu::gles2::FeatureInfo> feature_info =
132 new gpu::gles2::FeatureInfo(gpu_state_->gpu_driver_bug_workarounds()); 132 new gpu::gles2::FeatureInfo(gpu_state_->gpu_driver_bug_workarounds());
133 // TODO(erikchen): The ContextGroup needs a reference to the
134 // GpuMemoryBufferManager.
133 scoped_refptr<gpu::gles2::ContextGroup> context_group = 135 scoped_refptr<gpu::gles2::ContextGroup> context_group =
134 new gpu::gles2::ContextGroup( 136 new gpu::gles2::ContextGroup(
135 gpu_state_->gpu_preferences(), gpu_state_->mailbox_manager(), 137 gpu_state_->gpu_preferences(), gpu_state_->mailbox_manager(),
136 new GpuMemoryTracker, 138 new GpuMemoryTracker,
137 new gpu::gles2::ShaderTranslatorCache(gpu_state_->gpu_preferences()), 139 new gpu::gles2::ShaderTranslatorCache(gpu_state_->gpu_preferences()),
138 new gpu::gles2::FramebufferCompletenessCache, feature_info, 140 new gpu::gles2::FramebufferCompletenessCache, feature_info,
139 bind_generates_resource); 141 bind_generates_resource, nullptr);
140 142
141 command_buffer_.reset( 143 command_buffer_.reset(
142 new gpu::CommandBufferService(context_group->transfer_buffer_manager())); 144 new gpu::CommandBufferService(context_group->transfer_buffer_manager()));
143 145
144 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get())); 146 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get()));
145 executor_.reset(new gpu::CommandExecutor(command_buffer_.get(), 147 executor_.reset(new gpu::CommandExecutor(command_buffer_.get(),
146 decoder_.get(), decoder_.get())); 148 decoder_.get(), decoder_.get()));
147 sync_point_order_data_ = gpu::SyncPointOrderData::Create(); 149 sync_point_order_data_ = gpu::SyncPointOrderData::Create();
148 sync_point_client_ = gpu_state_->sync_point_manager()->CreateSyncPointClient( 150 sync_point_client_ = gpu_state_->sync_point_manager()->CreateSyncPointClient(
149 sync_point_order_data_, GetNamespaceID(), command_buffer_id_); 151 sync_point_order_data_, GetNamespaceID(), command_buffer_id_);
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 } 558 }
557 559
558 void CommandBufferDriver::OnGpuCompletedSwapBuffers(gfx::SwapResult result) { 560 void CommandBufferDriver::OnGpuCompletedSwapBuffers(gfx::SwapResult result) {
559 DCHECK(CalledOnValidThread()); 561 DCHECK(CalledOnValidThread());
560 if (client_) { 562 if (client_) {
561 client_->OnGpuCompletedSwapBuffers(result); 563 client_->OnGpuCompletedSwapBuffers(result);
562 } 564 }
563 } 565 }
564 566
565 } // namespace mus 567 } // namespace mus
OLDNEW
« no previous file with comments | « no previous file | gpu/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698