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

Unified Diff: mojo/services/gles2/command_buffer_impl.cc

Issue 734273002: Cleanse mojo/services/gles2 of InterfaceImpl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Moar interface request 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
« no previous file with comments | « mojo/services/gles2/command_buffer_impl.h ('k') | mojo/services/gles2/gpu_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/gles2/command_buffer_impl.cc
diff --git a/mojo/services/gles2/command_buffer_impl.cc b/mojo/services/gles2/command_buffer_impl.cc
index cd805e4dc34b35b69aff4b6b9e115a411ea78e3a..18d2f613e468d3dd2ac0773022f9c6447adad53f 100644
--- a/mojo/services/gles2/command_buffer_impl.cc
+++ b/mojo/services/gles2/command_buffer_impl.cc
@@ -44,15 +44,18 @@ class MemoryTrackerStub : public gpu::gles2::MemoryTracker {
} // anonymous namespace
CommandBufferImpl::CommandBufferImpl(
+ InterfaceRequest<CommandBuffer> request,
gfx::GLShareGroup* share_group,
gpu::gles2::MailboxManager* mailbox_manager)
- : widget_(gfx::kNullAcceleratedWidget),
- size_(1, 1),
- share_group_(share_group),
- mailbox_manager_(mailbox_manager) {
+ : CommandBufferImpl(request.Pass(),
+ gfx::kNullAcceleratedWidget,
+ gfx::Size(1, 1),
+ share_group,
+ mailbox_manager) {
}
CommandBufferImpl::CommandBufferImpl(
+ InterfaceRequest<CommandBuffer> request,
gfx::AcceleratedWidget widget,
const gfx::Size& size,
gfx::GLShareGroup* share_group,
@@ -60,11 +63,12 @@ CommandBufferImpl::CommandBufferImpl(
: widget_(widget),
size_(size),
share_group_(share_group),
- mailbox_manager_(mailbox_manager) {
+ mailbox_manager_(mailbox_manager),
+ binding_(this, request.Pass()) {
}
CommandBufferImpl::~CommandBufferImpl() {
- client()->DidDestroy();
+ binding_.client()->DidDestroy();
if (decoder_) {
bool have_context = decoder_->MakeCurrent();
decoder_->Destroy(have_context);
@@ -159,7 +163,7 @@ void CommandBufferImpl::SetGetBuffer(int32_t buffer) {
void CommandBufferImpl::Flush(int32_t put_offset) {
if (!context_->MakeCurrent(surface_.get())) {
DLOG(WARNING) << "Context lost";
- client()->LostContext(gpu::error::kUnknown);
+ binding_.client()->LostContext(gpu::error::kUnknown);
return;
}
command_buffer_->Flush(put_offset);
@@ -196,7 +200,7 @@ void CommandBufferImpl::Echo(const Callback<void()>& callback) {
void CommandBufferImpl::OnParseError() {
gpu::CommandBuffer::State state = command_buffer_->GetLastState();
- client()->LostContext(state.context_lost_reason);
+ binding_.client()->LostContext(state.context_lost_reason);
}
void CommandBufferImpl::OnResize(gfx::Size size, float scale_factor) {
« no previous file with comments | « mojo/services/gles2/command_buffer_impl.h ('k') | mojo/services/gles2/gpu_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698