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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 request2->url = mojo::String::From("mojo:mus"); | 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 nullptr, |
92 &LostContext, NULL, mojo::Environment::GetDefaultAsyncWaiter()); | 93 &LostContext, NULL, mojo::Environment::GetDefaultAsyncWaiter()); |
93 MojoGLES2MakeCurrent(gles2_context_); | 94 MojoGLES2MakeCurrent(gles2_context_); |
94 } | 95 } |
95 | 96 |
96 // Sets the color which is RGBA. | 97 // Sets the color which is RGBA. |
97 void SetColor(uint32_t color) { | 98 void SetColor(uint32_t color) { |
98 if (color_ == color) | 99 if (color_ == color) |
99 return; | 100 return; |
100 color_ = color; | 101 color_ = color; |
101 if (surface_) | 102 if (surface_) |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 DISALLOW_COPY_AND_ASSIGN(PDFViewer); | 519 DISALLOW_COPY_AND_ASSIGN(PDFViewer); |
519 }; | 520 }; |
520 | 521 |
521 } // namespace | 522 } // namespace |
522 } // namespace pdf_viewer | 523 } // namespace pdf_viewer |
523 | 524 |
524 MojoResult MojoMain(MojoHandle application_request) { | 525 MojoResult MojoMain(MojoHandle application_request) { |
525 mojo::ApplicationRunner runner(new pdf_viewer::PDFViewer()); | 526 mojo::ApplicationRunner runner(new pdf_viewer::PDFViewer()); |
526 return runner.Run(application_request); | 527 return runner.Run(application_request); |
527 } | 528 } |
OLD | NEW |