| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "examples/shadows/shadows_view.h" | 5 #include "examples/shadows/shadows_view.h" |
| 6 | 6 |
| 7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
| 8 #include <GLES2/gl2ext.h> | 8 #include <GLES2/gl2ext.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "mojo/services/geometry/cpp/geometry_util.h" | 12 #include "mojo/services/geometry/cpp/geometry_util.h" |
| 13 | 13 |
| 14 namespace examples { | 14 namespace examples { |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 constexpr uint32_t kContentImageResourceId = 1; | 17 constexpr uint32_t kContentImageResourceId = 1; |
| 18 constexpr uint32_t kRootNodeId = mojo::gfx::composition::kSceneRootNodeId; | 18 constexpr uint32_t kRootNodeId = mojo::gfx::composition::kSceneRootNodeId; |
| 19 } // namespace | 19 } // namespace |
| 20 | 20 |
| 21 ShadowsView::ShadowsView( | 21 ShadowsView::ShadowsView( |
| 22 mojo::ApplicationImpl* app_impl, | 22 mojo::InterfaceHandle<mojo::ApplicationConnector> app_connector, |
| 23 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request) | 23 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request) |
| 24 : GLView(app_impl, view_owner_request.Pass(), "Shadows"), | 24 : GLView(app_connector.Pass(), view_owner_request.Pass(), "Shadows"), |
| 25 choreographer_(scene(), this) { | 25 choreographer_(scene(), this) { |
| 26 mojo::GLContext::Scope gl_scope(gl_context()); | 26 mojo::GLContext::Scope gl_scope(gl_context()); |
| 27 renderer_.reset(new ShadowsRenderer()); | 27 renderer_.reset(new ShadowsRenderer()); |
| 28 } | 28 } |
| 29 | 29 |
| 30 ShadowsView::~ShadowsView() {} | 30 ShadowsView::~ShadowsView() {} |
| 31 | 31 |
| 32 void ShadowsView::OnPropertiesChanged( | 32 void ShadowsView::OnPropertiesChanged( |
| 33 uint32_t old_scene_version, | 33 uint32_t old_scene_version, |
| 34 mojo::ui::ViewPropertiesPtr old_properties) { | 34 mojo::ui::ViewPropertiesPtr old_properties) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 metadata->presentation_time = frame_info.presentation_time; | 78 metadata->presentation_time = frame_info.presentation_time; |
| 79 scene()->Publish(metadata.Pass()); | 79 scene()->Publish(metadata.Pass()); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void ShadowsView::Render(const mojo::GLContext::Scope& gl_scope, | 82 void ShadowsView::Render(const mojo::GLContext::Scope& gl_scope, |
| 83 const mojo::Size& size) { | 83 const mojo::Size& size) { |
| 84 renderer_->Render(size); | 84 renderer_->Render(size); |
| 85 } | 85 } |
| 86 | 86 |
| 87 } // namespace examples | 87 } // namespace examples |
| OLD | NEW |