| 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 "mojo/aura/surface_binding.h" | 5 #include "mojo/aura/surface_binding.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 if (frame_size != surface_size_) { | 93 if (frame_size != surface_size_) { |
| 94 if (!surface_id_.is_null()) | 94 if (!surface_id_.is_null()) |
| 95 surface_->DestroySurface(SurfaceId::From(surface_id_)); | 95 surface_->DestroySurface(SurfaceId::From(surface_id_)); |
| 96 surface_id_ = id_allocator_->GenerateId(); | 96 surface_id_ = id_allocator_->GenerateId(); |
| 97 surface_->CreateSurface(SurfaceId::From(surface_id_), | 97 surface_->CreateSurface(SurfaceId::From(surface_id_), |
| 98 Size::From(frame_size)); | 98 Size::From(frame_size)); |
| 99 view_->SetSurfaceId(SurfaceId::From(surface_id_)); | 99 view_->SetSurfaceId(SurfaceId::From(surface_id_)); |
| 100 surface_size_ = frame_size; | 100 surface_size_ = frame_size; |
| 101 } | 101 } |
| 102 | 102 |
| 103 surface_->SubmitFrame(SurfaceId::From(surface_id_), Frame::From(*frame)); | 103 surface_->SubmitFrame(SurfaceId::From(surface_id_), Frame::From(*frame), |
| 104 mojo::Closure()); |
| 104 | 105 |
| 105 client_->DidSwapBuffers(); | 106 client_->DidSwapBuffers(); |
| 106 client_->DidSwapBuffersComplete(); | 107 client_->DidSwapBuffersComplete(); |
| 107 } | 108 } |
| 108 | 109 |
| 109 } // namespace | 110 } // namespace |
| 110 | 111 |
| 111 // PerViewManagerState --------------------------------------------------------- | 112 // PerViewManagerState --------------------------------------------------------- |
| 112 | 113 |
| 113 // State needed per ViewManager. Provides the real implementation of | 114 // State needed per ViewManager. Provides the real implementation of |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 } | 243 } |
| 243 | 244 |
| 244 SurfaceBinding::~SurfaceBinding() { | 245 SurfaceBinding::~SurfaceBinding() { |
| 245 } | 246 } |
| 246 | 247 |
| 247 scoped_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() { | 248 scoped_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() { |
| 248 return state_->CreateOutputSurface(view_); | 249 return state_->CreateOutputSurface(view_); |
| 249 } | 250 } |
| 250 | 251 |
| 251 } // namespace mojo | 252 } // namespace mojo |
| OLD | NEW |