| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/containers/hash_tables.h" | 7 #include "base/containers/hash_tables.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "components/mus/public/cpp/scoped_window_ptr.h" | 9 #include "components/mus/public/cpp/scoped_window_ptr.h" |
| 10 #include "components/mus/public/cpp/types.h" | 10 #include "components/mus/public/cpp/types.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 } | 278 } |
| 279 | 279 |
| 280 // SurfaceClient implementation. | 280 // SurfaceClient implementation. |
| 281 void ReturnResources( | 281 void ReturnResources( |
| 282 mojo::Array<mus::mojom::ReturnedResourcePtr> resources) override { | 282 mojo::Array<mus::mojom::ReturnedResourcePtr> resources) override { |
| 283 MojoGLES2MakeCurrent(gles2_context_); | 283 MojoGLES2MakeCurrent(gles2_context_); |
| 284 // TODO(jamesr): Recycle. | 284 // TODO(jamesr): Recycle. |
| 285 for (size_t i = 0; i < resources.size(); ++i) { | 285 for (size_t i = 0; i < resources.size(); ++i) { |
| 286 mus::mojom::ReturnedResourcePtr resource = resources[i].Pass(); | 286 mus::mojom::ReturnedResourcePtr resource = resources[i].Pass(); |
| 287 DCHECK_EQ(1, resource->count); | 287 DCHECK_EQ(1, resource->count); |
| 288 glWaitSyncPointCHROMIUM(resource->sync_point); | 288 glWaitSyncPointCHROMIUM(resource->sync_point, resource->sync_token); |
| 289 uint32_t texture_id = resource_to_texture_id_map_[resource->id]; | 289 uint32_t texture_id = resource_to_texture_id_map_[resource->id]; |
| 290 DCHECK_NE(0u, texture_id); | 290 DCHECK_NE(0u, texture_id); |
| 291 resource_to_texture_id_map_.erase(resource->id); | 291 resource_to_texture_id_map_.erase(resource->id); |
| 292 glDeleteTextures(1, &texture_id); | 292 glDeleteTextures(1, &texture_id); |
| 293 } | 293 } |
| 294 } | 294 } |
| 295 | 295 |
| 296 mus::Window* view_; | 296 mus::Window* view_; |
| 297 mus::mojom::GpuPtr gpu_service_; | 297 mus::mojom::GpuPtr gpu_service_; |
| 298 scoped_ptr<mus::WindowSurface> surface_; | 298 scoped_ptr<mus::WindowSurface> surface_; |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 | 624 |
| 625 DISALLOW_COPY_AND_ASSIGN(PDFViewer); | 625 DISALLOW_COPY_AND_ASSIGN(PDFViewer); |
| 626 }; | 626 }; |
| 627 } // namespace | 627 } // namespace |
| 628 } // namespace pdf_viewer | 628 } // namespace pdf_viewer |
| 629 | 629 |
| 630 MojoResult MojoMain(MojoHandle application_request) { | 630 MojoResult MojoMain(MojoHandle application_request) { |
| 631 mojo::ApplicationRunner runner(new pdf_viewer::PDFViewer()); | 631 mojo::ApplicationRunner runner(new pdf_viewer::PDFViewer()); |
| 632 return runner.Run(application_request); | 632 return runner.Run(application_request); |
| 633 } | 633 } |
| OLD | NEW |