Chromium Code Reviews| 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 "sky/compositor/layer_host.h" | 5 #include "sky/compositor/layer_host.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "mojo/converters/geometry/geometry_type_converters.h" | 8 #include "mojo/converters/geometry/geometry_type_converters.h" |
| 9 #include "mojo/gpu/gl_context.h" | 9 #include "mojo/gpu/gl_context.h" |
| 10 #include "mojo/services/public/cpp/surfaces/surfaces_utils.h" | 10 #include "mojo/services/public/cpp/surfaces/surfaces_utils.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 } | 42 } |
| 43 | 43 |
| 44 void LayerHost::ReturnResources( | 44 void LayerHost::ReturnResources( |
| 45 mojo::Array<mojo::ReturnedResourcePtr> resources) { | 45 mojo::Array<mojo::ReturnedResourcePtr> resources) { |
| 46 resource_manager_.ReturnResources(resources.Pass()); | 46 resource_manager_.ReturnResources(resources.Pass()); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void LayerHost::BeginFrame(base::TimeTicks frame_time, | 49 void LayerHost::BeginFrame(base::TimeTicks frame_time, |
| 50 base::TimeTicks deadline) { | 50 base::TimeTicks deadline) { |
| 51 client_->BeginFrame(frame_time); | 51 client_->BeginFrame(frame_time); |
| 52 root_layer_->Display(); | 52 |
| 53 { | |
| 54 mojo::GaneshContext::Scope scope(&ganesh_context_); | |
| 55 ganesh_context_.gr()->resetContext(); | |
|
esprehn
2014/11/21 17:53:19
Why not do this inside the Display() call like bef
abarth-chromium
2014/11/21 17:56:52
It doesn't really matter today because we only hav
| |
| 56 root_layer_->Display(); | |
| 57 } | |
| 58 | |
| 53 Upload(root_layer_.get()); | 59 Upload(root_layer_.get()); |
| 54 } | 60 } |
| 55 | 61 |
| 56 void LayerHost::Upload(Layer* layer) { | 62 void LayerHost::Upload(Layer* layer) { |
| 57 gfx::Size size = layer->size(); | 63 gfx::Size size = layer->size(); |
| 58 surface_holder_.SetSize(size); | 64 surface_holder_.SetSize(size); |
| 59 | 65 |
| 60 mojo::FramePtr frame = mojo::Frame::New(); | 66 mojo::FramePtr frame = mojo::Frame::New(); |
| 61 frame->resources.resize(0u); | 67 frame->resources.resize(0u); |
| 62 | 68 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 | 104 |
| 99 frame->resources.push_back(resource.Pass()); | 105 frame->resources.push_back(resource.Pass()); |
| 100 quad->texture_quad_state = texture_state.Pass(); | 106 quad->texture_quad_state = texture_state.Pass(); |
| 101 pass->quads.push_back(quad.Pass()); | 107 pass->quads.push_back(quad.Pass()); |
| 102 | 108 |
| 103 frame->passes.push_back(pass.Pass()); | 109 frame->passes.push_back(pass.Pass()); |
| 104 surface_holder_.SubmitFrame(frame.Pass()); | 110 surface_holder_.SubmitFrame(frame.Pass()); |
| 105 } | 111 } |
| 106 | 112 |
| 107 } // namespace sky | 113 } // namespace sky |
| OLD | NEW |