| 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 #ifndef APPS_MOTERM_MOTERM_VIEW_H_ | 5 #ifndef APPS_MOTERM_MOTERM_VIEW_H_ |
| 6 #define APPS_MOTERM_MOTERM_VIEW_H_ | 6 #define APPS_MOTERM_MOTERM_VIEW_H_ |
| 7 | 7 |
| 8 #include "apps/moterm/gl_helper.h" | 8 #include "apps/moterm/gl_helper.h" |
| 9 #include "apps/moterm/moterm_driver.h" | 9 #include "apps/moterm/moterm_driver.h" |
| 10 #include "apps/moterm/moterm_model.h" | 10 #include "apps/moterm/moterm_model.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "mojo/common/weak_binding_set.h" | 13 #include "mojo/common/binding_set.h" |
| 14 #include "mojo/public/cpp/application/interface_factory.h" | 14 #include "mojo/public/cpp/application/interface_factory.h" |
| 15 #include "mojo/public/cpp/application/service_provider_impl.h" | 15 #include "mojo/public/cpp/application/service_provider_impl.h" |
| 16 #include "mojo/public/cpp/bindings/callback.h" | 16 #include "mojo/public/cpp/bindings/callback.h" |
| 17 #include "mojo/public/cpp/bindings/interface_request.h" | 17 #include "mojo/public/cpp/bindings/interface_request.h" |
| 18 #include "mojo/services/surfaces/public/interfaces/surface_id.mojom.h" | 18 #include "mojo/services/surfaces/public/interfaces/surface_id.mojom.h" |
| 19 #include "mojo/services/terminal/public/interfaces/terminal.mojom.h" | 19 #include "mojo/services/terminal/public/interfaces/terminal.mojom.h" |
| 20 #include "mojo/services/view_manager/public/cpp/view_observer.h" | 20 #include "mojo/services/view_manager/public/cpp/view_observer.h" |
| 21 #include "skia/ext/refptr.h" | 21 #include "skia/ext/refptr.h" |
| 22 #include "third_party/skia/include/core/SkBitmapDevice.h" | 22 #include "third_party/skia/include/core/SkBitmapDevice.h" |
| 23 #include "third_party/skia/include/core/SkTypeface.h" | 23 #include "third_party/skia/include/core/SkTypeface.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // The terminal model. | 88 // The terminal model. |
| 89 MotermModel model_; | 89 MotermModel model_; |
| 90 // State changes to the model since last draw. | 90 // State changes to the model since last draw. |
| 91 MotermModel::StateChanges model_state_changes_; | 91 MotermModel::StateChanges model_state_changes_; |
| 92 | 92 |
| 93 base::WeakPtr<MotermDriver> driver_; | 93 base::WeakPtr<MotermDriver> driver_; |
| 94 // If set, called when we get |OnClosed()| or |OnDestroyed()| from the driver. | 94 // If set, called when we get |OnClosed()| or |OnDestroyed()| from the driver. |
| 95 mojo::Closure on_closed_callback_; | 95 mojo::Closure on_closed_callback_; |
| 96 | 96 |
| 97 mojo::ServiceProviderImpl service_provider_impl_; | 97 mojo::ServiceProviderImpl service_provider_impl_; |
| 98 mojo::WeakBindingSet<mojo::terminal::Terminal> terminal_bindings_; | 98 mojo::BindingSet<mojo::terminal::Terminal> terminal_bindings_; |
| 99 | 99 |
| 100 // TODO(vtl): For some reason, drawing while a frame is already pending (i.e., | 100 // TODO(vtl): For some reason, drawing while a frame is already pending (i.e., |
| 101 // we've submitted it but haven't gotten a callback) interacts badly with | 101 // we've submitted it but haven't gotten a callback) interacts badly with |
| 102 // resizing -- sometimes this results in us losing all future | 102 // resizing -- sometimes this results in us losing all future |
| 103 // |OnViewBoundsChanged()| messages. So, for now, don't submit frames in that | 103 // |OnViewBoundsChanged()| messages. So, for now, don't submit frames in that |
| 104 // case. | 104 // case. |
| 105 bool frame_pending_; | 105 bool frame_pending_; |
| 106 // If we skip drawing despite being forced to, we should force the next draw. | 106 // If we skip drawing despite being forced to, we should force the next draw. |
| 107 bool force_next_draw_; | 107 bool force_next_draw_; |
| 108 | 108 |
| 109 skia::RefPtr<SkTypeface> regular_typeface_; | 109 skia::RefPtr<SkTypeface> regular_typeface_; |
| 110 | 110 |
| 111 int ascent_; | 111 int ascent_; |
| 112 int line_height_; | 112 int line_height_; |
| 113 int advance_width_; | 113 int advance_width_; |
| 114 | 114 |
| 115 skia::RefPtr<SkBitmapDevice> bitmap_device_; | 115 skia::RefPtr<SkBitmapDevice> bitmap_device_; |
| 116 | 116 |
| 117 DISALLOW_COPY_AND_ASSIGN(MotermView); | 117 DISALLOW_COPY_AND_ASSIGN(MotermView); |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 #endif // APPS_MOTERM_MOTERM_VIEW_H_ | 120 #endif // APPS_MOTERM_MOTERM_VIEW_H_ |
| OLD | NEW |