| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "examples/ganesh_app/texture_uploader.h" | 5 #include "examples/ganesh_app/texture_uploader.h" |
| 6 | 6 |
| 7 #ifndef GL_GLEXT_PROTOTYPES | 7 #ifndef GL_GLEXT_PROTOTYPES |
| 8 #define GL_GLEXT_PROTOTYPES | 8 #define GL_GLEXT_PROTOTYPES |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 base::WeakPtr<mojo::GLContext> context) | 27 base::WeakPtr<mojo::GLContext> context) |
| 28 : client_(client), | 28 : client_(client), |
| 29 context_(context), | 29 context_(context), |
| 30 next_resource_id_(0), | 30 next_resource_id_(0), |
| 31 id_namespace_(0), | 31 id_namespace_(0), |
| 32 weak_factory_(this) { | 32 weak_factory_(this) { |
| 33 context_->AddObserver(this); | 33 context_->AddObserver(this); |
| 34 | 34 |
| 35 mojo::ServiceProviderPtr surfaces_service_provider; | 35 mojo::ServiceProviderPtr surfaces_service_provider; |
| 36 shell->ConnectToApplication("mojo:surfaces_service", | 36 shell->ConnectToApplication("mojo:surfaces_service", |
| 37 mojo::GetProxy(&surfaces_service_provider)); | 37 mojo::GetProxy(&surfaces_service_provider), |
| 38 mojo::ServiceProviderPtr()); |
| 38 mojo::ConnectToService(surfaces_service_provider.get(), &surfaces_service_); | 39 mojo::ConnectToService(surfaces_service_provider.get(), &surfaces_service_); |
| 39 | 40 |
| 40 surfaces_service_->CreateSurfaceConnection( | 41 surfaces_service_->CreateSurfaceConnection( |
| 41 base::Bind(&TextureUploader::OnSurfaceConnectionCreated, | 42 base::Bind(&TextureUploader::OnSurfaceConnectionCreated, |
| 42 weak_factory_.GetWeakPtr())); | 43 weak_factory_.GetWeakPtr())); |
| 43 } | 44 } |
| 44 | 45 |
| 45 TextureUploader::~TextureUploader() { | 46 TextureUploader::~TextureUploader() { |
| 46 if (surface_id_) | 47 if (surface_id_) |
| 47 surface_->DestroySurface(surface_id_.Clone()); | 48 surface_->DestroySurface(surface_id_.Clone()); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 uint32_t id_namespace) { | 169 uint32_t id_namespace) { |
| 169 surface_ = surface.Pass(); | 170 surface_ = surface.Pass(); |
| 170 surface_.set_client(this); | 171 surface_.set_client(this); |
| 171 id_namespace_ = id_namespace; | 172 id_namespace_ = id_namespace; |
| 172 | 173 |
| 173 if (pending_upload_) | 174 if (pending_upload_) |
| 174 Upload(pending_upload_.Pass()); | 175 Upload(pending_upload_.Pass()); |
| 175 } | 176 } |
| 176 | 177 |
| 177 } // namespace examples | 178 } // namespace examples |
| OLD | NEW |