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 #include "services/native_viewport/viewport_surface.h" | 5 #include "services/native_viewport/viewport_surface.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "mojo/converters/geometry/geometry_type_converters.h" | 8 #include "mojo/converters/geometry/geometry_type_converters.h" |
9 #include "mojo/converters/surfaces/surfaces_type_converters.h" | 9 #include "mojo/converters/surfaces/surfaces_type_converters.h" |
10 #include "mojo/services/surfaces/public/cpp/surfaces_utils.h" | 10 #include "mojo/services/surfaces/public/cpp/surfaces_utils.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 mojo::Gpu* gpu_service, | 21 mojo::Gpu* gpu_service, |
22 const gfx::Size& size, | 22 const gfx::Size& size, |
23 cc::SurfaceId child_id) | 23 cc::SurfaceId child_id) |
24 : surface_(surface.Pass()), | 24 : surface_(surface.Pass()), |
25 gpu_service_(gpu_service), | 25 gpu_service_(gpu_service), |
26 widget_id_(0u), | 26 widget_id_(0u), |
27 size_(size), | 27 size_(size), |
28 gles2_bound_surface_created_(false), | 28 gles2_bound_surface_created_(false), |
29 child_id_(child_id), | 29 child_id_(child_id), |
30 weak_factory_(this) { | 30 weak_factory_(this) { |
31 surface_.set_client(this); | |
32 } | 31 } |
33 | 32 |
34 ViewportSurface::~ViewportSurface() { | 33 ViewportSurface::~ViewportSurface() { |
35 } | 34 } |
36 | 35 |
37 void ViewportSurface::SetWidgetId(uint64_t widget_id) { | 36 void ViewportSurface::SetWidgetId(uint64_t widget_id) { |
38 widget_id_ = widget_id; | 37 widget_id_ = widget_id; |
39 BindSurfaceToNativeViewport(); | 38 BindSurfaceToNativeViewport(); |
40 } | 39 } |
41 | 40 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 pass->shared_quad_states.push_back(CreateDefaultSQS( | 96 pass->shared_quad_states.push_back(CreateDefaultSQS( |
98 *mojo::Size::From(size_))); | 97 *mojo::Size::From(size_))); |
99 | 98 |
100 auto frame = mojo::Frame::New(); | 99 auto frame = mojo::Frame::New(); |
101 frame->passes.push_back(pass.Pass()); | 100 frame->passes.push_back(pass.Pass()); |
102 frame->resources.resize(0u); | 101 frame->resources.resize(0u); |
103 surface_->SubmitFrame(kGLES2BoundSurfaceLocalId, frame.Pass(), | 102 surface_->SubmitFrame(kGLES2BoundSurfaceLocalId, frame.Pass(), |
104 mojo::Closure()); | 103 mojo::Closure()); |
105 } | 104 } |
106 | 105 |
107 void ViewportSurface::SetIdNamespace(uint32_t id_namespace) { | |
108 // We never pass our surface ID to anyone else, so we never need to generate a | |
109 // fully qualified id and thus don't care about our namespace. | |
110 } | |
111 | |
112 void ViewportSurface::ReturnResources( | |
113 mojo::Array<mojo::ReturnedResourcePtr> resources) { | |
114 // We never submit resources so we should never get any back. | |
115 DCHECK_EQ(0u, resources.size()); | |
116 } | |
117 | |
118 } // namespace native_viewport | 106 } // namespace native_viewport |
OLD | NEW |