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

Side by Side Diff: mojo/services/gles2/command_buffer_impl.cc

Issue 380413003: Mojo: Use InterfaceFactory<Interface> for service registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix message loop destruction order Created 6 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 | Annotate | Revision Log
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 "mojo/services/gles2/command_buffer_impl.h" 5 #include "mojo/services/gles2/command_buffer_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/shared_memory.h" 8 #include "base/memory/shared_memory.h"
9 9
10 #include "gpu/command_buffer/common/constants.h" 10 #include "gpu/command_buffer/common/constants.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 : widget_(widget), size_(size) {} 51 : widget_(widget), size_(size) {}
52 52
53 CommandBufferImpl::~CommandBufferImpl() { 53 CommandBufferImpl::~CommandBufferImpl() {
54 client()->DidDestroy(); 54 client()->DidDestroy();
55 if (decoder_) { 55 if (decoder_) {
56 bool have_context = decoder_->MakeCurrent(); 56 bool have_context = decoder_->MakeCurrent();
57 decoder_->Destroy(have_context); 57 decoder_->Destroy(have_context);
58 } 58 }
59 } 59 }
60 60
61 void CommandBufferImpl::OnConnectionError() {
62 // TODO(darin): How should we handle this error?
63 }
64
65 void CommandBufferImpl::Initialize( 61 void CommandBufferImpl::Initialize(
66 CommandBufferSyncClientPtr sync_client, 62 CommandBufferSyncClientPtr sync_client,
67 mojo::ScopedSharedBufferHandle shared_state) { 63 mojo::ScopedSharedBufferHandle shared_state) {
68 sync_client_ = sync_client.Pass(); 64 sync_client_ = sync_client.Pass();
69 sync_client_->DidInitialize(DoInitialize(shared_state.Pass())); 65 sync_client_->DidInitialize(DoInitialize(shared_state.Pass()));
70 } 66 }
71 67
72 bool CommandBufferImpl::DoInitialize( 68 bool CommandBufferImpl::DoInitialize(
73 mojo::ScopedSharedBufferHandle shared_state) { 69 mojo::ScopedSharedBufferHandle shared_state) {
74 // TODO(piman): offscreen surface. 70 // TODO(piman): offscreen surface.
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 185 }
190 186
191 void CommandBufferImpl::DrawAnimationFrame() { client()->DrawAnimationFrame(); } 187 void CommandBufferImpl::DrawAnimationFrame() { client()->DrawAnimationFrame(); }
192 188
193 void CommandBufferImpl::OnResize(gfx::Size size, float scale_factor) { 189 void CommandBufferImpl::OnResize(gfx::Size size, float scale_factor) {
194 surface_->Resize(size); 190 surface_->Resize(size);
195 } 191 }
196 192
197 } // namespace services 193 } // namespace services
198 } // namespace mojo 194 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698