| OLD | NEW |
| 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/native_viewport/native_viewport_service.h" | 5 #include "mojo/services/native_viewport/native_viewport_service.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 DCHECK(native_viewport_); | 66 DCHECK(native_viewport_); |
| 67 native_viewport_->Close(); | 67 native_viewport_->Close(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 virtual void SetBounds(RectPtr bounds) OVERRIDE { | 70 virtual void SetBounds(RectPtr bounds) OVERRIDE { |
| 71 native_viewport_->SetBounds(bounds.To<gfx::Rect>()); | 71 native_viewport_->SetBounds(bounds.To<gfx::Rect>()); |
| 72 } | 72 } |
| 73 | 73 |
| 74 virtual void CreateGLES2Context( | 74 virtual void CreateGLES2Context( |
| 75 InterfaceRequest<CommandBuffer> command_buffer_request) OVERRIDE { | 75 InterfaceRequest<CommandBuffer> command_buffer_request) OVERRIDE { |
| 76 if (command_buffer_.get() || command_buffer_request_.is_pending()) { | 76 if (command_buffer_ || command_buffer_request_.is_pending()) { |
| 77 LOG(ERROR) << "Can't create multiple contexts on a NativeViewport"; | 77 LOG(ERROR) << "Can't create multiple contexts on a NativeViewport"; |
| 78 return; | 78 return; |
| 79 } | 79 } |
| 80 command_buffer_request_ = command_buffer_request.Pass(); | 80 command_buffer_request_ = command_buffer_request.Pass(); |
| 81 CreateCommandBufferIfNeeded(); | 81 CreateCommandBufferIfNeeded(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void AckEvent() { | 84 void AckEvent() { |
| 85 waiting_for_event_ack_ = false; | 85 waiting_for_event_ack_ = false; |
| 86 } | 86 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 } // namespace mojo | 174 } // namespace mojo |
| 175 | 175 |
| 176 MOJO_NATIVE_VIEWPORT_EXPORT mojo::ApplicationImpl* | 176 MOJO_NATIVE_VIEWPORT_EXPORT mojo::ApplicationImpl* |
| 177 CreateNativeViewportService( | 177 CreateNativeViewportService( |
| 178 mojo::shell::Context* context, | 178 mojo::shell::Context* context, |
| 179 mojo::ScopedMessagePipeHandle service_provider_handle) { | 179 mojo::ScopedMessagePipeHandle service_provider_handle) { |
| 180 mojo::ApplicationImpl* app = new mojo::ApplicationImpl( | 180 mojo::ApplicationImpl* app = new mojo::ApplicationImpl( |
| 181 new mojo::services::NVSDelegate(context), service_provider_handle.Pass()); | 181 new mojo::services::NVSDelegate(context), service_provider_handle.Pass()); |
| 182 return app; | 182 return app; |
| 183 } | 183 } |
| OLD | NEW |