| 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 "mojo/services/surfaces/display_impl.h" | 5 #include "mojo/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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 gfx::Size frame_size = | 75 gfx::Size frame_size = |
| 76 pending_frame_->passes[0]->output_rect.To<gfx::Rect>().size(); | 76 pending_frame_->passes[0]->output_rect.To<gfx::Rect>().size(); |
| 77 display_->Resize(frame_size); | 77 display_->Resize(frame_size); |
| 78 factory_.SubmitFrame(cc_id_, | 78 factory_.SubmitFrame(cc_id_, |
| 79 pending_frame_.To<scoped_ptr<cc::CompositorFrame>>(), | 79 pending_frame_.To<scoped_ptr<cc::CompositorFrame>>(), |
| 80 base::Bind(&CallCallback, pending_callback_)); | 80 base::Bind(&CallCallback, pending_callback_)); |
| 81 scheduler_->SetNeedsDraw(); | 81 scheduler_->SetNeedsDraw(); |
| 82 pending_callback_.reset(); | 82 pending_callback_.reset(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void DisplayImpl::DisplayDamaged() { | |
| 86 } | |
| 87 | |
| 88 void DisplayImpl::DidSwapBuffers() { | |
| 89 } | |
| 90 | |
| 91 void DisplayImpl::DidSwapBuffersComplete() { | |
| 92 } | |
| 93 | |
| 94 void DisplayImpl::CommitVSyncParameters(base::TimeTicks timebase, | 85 void DisplayImpl::CommitVSyncParameters(base::TimeTicks timebase, |
| 95 base::TimeDelta interval) { | 86 base::TimeDelta interval) { |
| 96 } | 87 } |
| 97 | 88 |
| 98 void DisplayImpl::OutputSurfaceLost() { | 89 void DisplayImpl::OutputSurfaceLost() { |
| 99 // If our OutputSurface is lost we can't draw until we get a new one. For now, | 90 // If our OutputSurface is lost we can't draw until we get a new one. For now, |
| 100 // destroy the display and create a new one when our ContextProvider provides | 91 // destroy the display and create a new one when our ContextProvider provides |
| 101 // a new one. | 92 // a new one. |
| 102 // TODO: This is more violent than necessary - we could simply remove this | 93 // TODO: This is more violent than necessary - we could simply remove this |
| 103 // display from the scheduler's set and pass a new context in to the | 94 // display from the scheduler's set and pass a new context in to the |
| (...skipping 24 matching lines...) Expand all Loading... |
| 128 DCHECK(returner_); | 119 DCHECK(returner_); |
| 129 | 120 |
| 130 mojo::Array<mojo::ReturnedResourcePtr> ret(resources.size()); | 121 mojo::Array<mojo::ReturnedResourcePtr> ret(resources.size()); |
| 131 for (size_t i = 0; i < resources.size(); ++i) { | 122 for (size_t i = 0; i < resources.size(); ++i) { |
| 132 ret[i] = mojo::ReturnedResource::From(resources[i]); | 123 ret[i] = mojo::ReturnedResource::From(resources[i]); |
| 133 } | 124 } |
| 134 returner_->ReturnResources(ret.Pass()); | 125 returner_->ReturnResources(ret.Pass()); |
| 135 } | 126 } |
| 136 | 127 |
| 137 } // namespace surfaces | 128 } // namespace surfaces |
| OLD | NEW |