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/types.h" | 9 #include "components/mus/public/cpp/types.h" |
10 #include "components/mus/public/cpp/view.h" | 10 #include "components/mus/public/cpp/view.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 ~BitmapUploader() override { | 72 ~BitmapUploader() override { |
73 MojoGLES2DestroyContext(gles2_context_); | 73 MojoGLES2DestroyContext(gles2_context_); |
74 } | 74 } |
75 | 75 |
76 void Init(mojo::Shell* shell) { | 76 void Init(mojo::Shell* shell) { |
77 surface_ = view_->RequestSurface(); | 77 surface_ = view_->RequestSurface(); |
78 surface_->BindToThread(); | 78 surface_->BindToThread(); |
79 | 79 |
80 mojo::ServiceProviderPtr gpu_service_provider; | 80 mojo::ServiceProviderPtr gpu_service_provider; |
81 mojo::URLRequestPtr request2(mojo::URLRequest::New()); | 81 mojo::URLRequestPtr request2(mojo::URLRequest::New()); |
82 request2->url = mojo::String::From("mojo:view_manager"); | 82 request2->url = mojo::String::From("mojo:mus"); |
83 shell->ConnectToApplication(request2.Pass(), | 83 shell->ConnectToApplication(request2.Pass(), |
84 mojo::GetProxy(&gpu_service_provider), nullptr, | 84 mojo::GetProxy(&gpu_service_provider), nullptr, |
85 nullptr, base::Bind(&OnGotContentHandlerID)); | 85 nullptr, base::Bind(&OnGotContentHandlerID)); |
86 ConnectToService(gpu_service_provider.get(), &gpu_service_); | 86 ConnectToService(gpu_service_provider.get(), &gpu_service_); |
87 | 87 |
88 mojo::CommandBufferPtr gles2_client; | 88 mojo::CommandBufferPtr gles2_client; |
89 gpu_service_->CreateOffscreenGLES2Context(GetProxy(&gles2_client)); | 89 gpu_service_->CreateOffscreenGLES2Context(GetProxy(&gles2_client)); |
90 gles2_context_ = MojoGLES2CreateContext( | 90 gles2_context_ = MojoGLES2CreateContext( |
91 gles2_client.PassInterface().PassHandle().release().value(), | 91 gles2_client.PassInterface().PassHandle().release().value(), |
92 &LostContext, NULL, mojo::Environment::GetDefaultAsyncWaiter()); | 92 &LostContext, NULL, mojo::Environment::GetDefaultAsyncWaiter()); |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 DISALLOW_COPY_AND_ASSIGN(PDFViewer); | 515 DISALLOW_COPY_AND_ASSIGN(PDFViewer); |
516 }; | 516 }; |
517 | 517 |
518 } // namespace | 518 } // namespace |
519 } // namespace pdf_viewer | 519 } // namespace pdf_viewer |
520 | 520 |
521 MojoResult MojoMain(MojoHandle application_request) { | 521 MojoResult MojoMain(MojoHandle application_request) { |
522 mojo::ApplicationRunner runner(new pdf_viewer::PDFViewer()); | 522 mojo::ApplicationRunner runner(new pdf_viewer::PDFViewer()); |
523 return runner.Run(application_request); | 523 return runner.Run(application_request); |
524 } | 524 } |
OLD | NEW |