| 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 #ifndef SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_IMPL_H_ | 5 #ifndef SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_IMPL_H_ |
| 6 #define SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_IMPL_H_ | 6 #define SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_IMPL_H_ |
| 7 | 7 |
| 8 #include <set> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 10 #include "mojo/public/cpp/bindings/strong_binding.h" | 12 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 11 #include "mojo/services/gpu/public/interfaces/gpu.mojom.h" | 13 #include "mojo/services/gpu/public/interfaces/gpu.mojom.h" |
| 12 #include "mojo/services/native_viewport/public/interfaces/native_viewport.mojom.
h" | 14 #include "mojo/services/native_viewport/public/interfaces/native_viewport.mojom.
h" |
| 13 #include "services/native_viewport/onscreen_context_provider.h" | 15 #include "services/native_viewport/onscreen_context_provider.h" |
| 14 #include "services/native_viewport/platform_viewport.h" | 16 #include "services/native_viewport/platform_viewport.h" |
| 15 #include "ui/gfx/geometry/rect.h" | 17 #include "ui/gfx/geometry/rect.h" |
| 16 | 18 |
| 17 namespace gles2 { | 19 namespace gles2 { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // PlatformViewport::Delegate implementation. | 54 // PlatformViewport::Delegate implementation. |
| 53 void OnMetricsChanged(mojo::ViewportMetricsPtr metrics) override; | 55 void OnMetricsChanged(mojo::ViewportMetricsPtr metrics) override; |
| 54 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) override; | 56 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) override; |
| 55 void OnAcceleratedWidgetDestroyed() override; | 57 void OnAcceleratedWidgetDestroyed() override; |
| 56 bool OnEvent(mojo::EventPtr event) override; | 58 bool OnEvent(mojo::EventPtr event) override; |
| 57 void OnDestroyed() override; | 59 void OnDestroyed() override; |
| 58 | 60 |
| 59 // mojo::ErrorHandler implementation. | 61 // mojo::ErrorHandler implementation. |
| 60 void OnConnectionError() override; | 62 void OnConnectionError() override; |
| 61 | 63 |
| 62 void AckEvent(); | 64 private: |
| 65 // Callback when the dispatcher has processed a message we're waiting on |
| 66 // an ack from. |pointer_id| identifies the pointer the message was associated |
| 67 // with. |
| 68 void AckEvent(int32 pointer_id); |
| 63 | 69 |
| 64 private: | |
| 65 bool is_headless_; | 70 bool is_headless_; |
| 66 scoped_ptr<PlatformViewport> platform_viewport_; | 71 scoped_ptr<PlatformViewport> platform_viewport_; |
| 67 OnscreenContextProvider context_provider_; | 72 OnscreenContextProvider context_provider_; |
| 68 bool sent_metrics_; | 73 bool sent_metrics_; |
| 69 mojo::ViewportMetricsPtr metrics_; | 74 mojo::ViewportMetricsPtr metrics_; |
| 70 bool waiting_for_event_ack_; | |
| 71 CreateCallback create_callback_; | 75 CreateCallback create_callback_; |
| 72 RequestMetricsCallback metrics_callback_; | 76 RequestMetricsCallback metrics_callback_; |
| 73 mojo::NativeViewportEventDispatcherPtr event_dispatcher_; | 77 mojo::NativeViewportEventDispatcherPtr event_dispatcher_; |
| 74 mojo::Binding<mojo::NativeViewport> binding_; | 78 mojo::Binding<mojo::NativeViewport> binding_; |
| 75 base::WeakPtrFactory<NativeViewportImpl> weak_factory_; | 79 base::WeakPtrFactory<NativeViewportImpl> weak_factory_; |
| 76 | 80 |
| 81 // Set of pointer_ids we've sent a move to and are waiting on an ack. |
| 82 std::set<int32> pointers_waiting_on_ack_; |
| 83 |
| 77 DISALLOW_COPY_AND_ASSIGN(NativeViewportImpl); | 84 DISALLOW_COPY_AND_ASSIGN(NativeViewportImpl); |
| 78 }; | 85 }; |
| 79 | 86 |
| 80 } // namespace native_viewport | 87 } // namespace native_viewport |
| 81 | 88 |
| 82 #endif // SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_IMPL_H_ | 89 #endif // SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_IMPL_H_ |
| OLD | NEW |