Chromium Code Reviews| 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 #include "services/surfaces/display_impl.h" | 5 #include "services/surfaces/display_impl.h" |
| 6 | 6 |
| 7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
| 8 #include "cc/surfaces/display.h" | 8 #include "cc/surfaces/display.h" |
| 9 #include "mojo/converters/geometry/geometry_type_converters.h" | 9 #include "mojo/converters/geometry/geometry_type_converters.h" |
| 10 #include "mojo/converters/surfaces/surfaces_type_converters.h" | 10 #include "mojo/converters/surfaces/surfaces_type_converters.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 70 pending_callback_ = callback; | 70 pending_callback_ = callback; |
| 71 if (display_) | 71 if (display_) |
| 72 Draw(); | 72 Draw(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void DisplayImpl::Draw() { | 75 void DisplayImpl::Draw() { |
| 76 gfx::Size frame_size = | 76 gfx::Size frame_size = |
| 77 pending_frame_->passes[0]->output_rect.To<gfx::Rect>().size(); | 77 pending_frame_->passes[0]->output_rect.To<gfx::Rect>().size(); |
| 78 last_submitted_frame_size_ = frame_size; | 78 last_submitted_frame_size_ = frame_size; |
| 79 display_->Resize(frame_size); | 79 display_->Resize(frame_size); |
| 80 factory_.SubmitFrame(cc_id_, | 80 factory_.SubmitFrame( |
| 81 pending_frame_.To<scoped_ptr<cc::CompositorFrame>>(), | 81 cc_id_, pending_frame_.Clone().To<scoped_ptr<cc::CompositorFrame>>(), |
|
blundell
2015/05/04 15:11:49
I'm not an expert here, but this feels to me like
jamesr
2015/05/04 18:03:22
Hmm, do we need new frame data in the recover path
| |
| 82 base::Bind(&CallCallback, pending_callback_)); | 82 base::Bind(&CallCallback, pending_callback_)); |
| 83 scheduler_->SetNeedsDraw(); | 83 scheduler_->SetNeedsDraw(); |
| 84 pending_frame_.reset(); | |
| 85 pending_callback_.reset(); | 84 pending_callback_.reset(); |
| 86 } | 85 } |
| 87 | 86 |
| 88 void DisplayImpl::DisplayDamaged() { | 87 void DisplayImpl::DisplayDamaged() { |
| 89 } | 88 } |
| 90 | 89 |
| 91 void DisplayImpl::DidSwapBuffers() { | 90 void DisplayImpl::DidSwapBuffers() { |
| 92 } | 91 } |
| 93 | 92 |
| 94 void DisplayImpl::DidSwapBuffersComplete() { | 93 void DisplayImpl::DidSwapBuffersComplete() { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 DCHECK(returner_); | 126 DCHECK(returner_); |
| 128 | 127 |
| 129 mojo::Array<mojo::ReturnedResourcePtr> ret(resources.size()); | 128 mojo::Array<mojo::ReturnedResourcePtr> ret(resources.size()); |
| 130 for (size_t i = 0; i < resources.size(); ++i) { | 129 for (size_t i = 0; i < resources.size(); ++i) { |
| 131 ret[i] = mojo::ReturnedResource::From(resources[i]); | 130 ret[i] = mojo::ReturnedResource::From(resources[i]); |
| 132 } | 131 } |
| 133 returner_->ReturnResources(ret.Pass()); | 132 returner_->ReturnResources(ret.Pass()); |
| 134 } | 133 } |
| 135 | 134 |
| 136 } // namespace surfaces | 135 } // namespace surfaces |
| OLD | NEW |