| 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 "cc/surfaces/surface_display_output_surface.h" | 5 #include "cc/surfaces/surface_display_output_surface.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "cc/output/compositor_frame.h" | 8 #include "cc/output/compositor_frame.h" |
| 9 #include "cc/output/compositor_frame_ack.h" | 9 #include "cc/output/compositor_frame_ack.h" |
| 10 #include "cc/surfaces/display.h" | 10 #include "cc/surfaces/display.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 return false; | 90 return false; |
| 91 | 91 |
| 92 // We want the Display's output surface to hear about lost context, and since | 92 // We want the Display's output surface to hear about lost context, and since |
| 93 // this shares a context with it, we should not be listening for lost context | 93 // this shares a context with it, we should not be listening for lost context |
| 94 // callbacks on the context here. | 94 // callbacks on the context here. |
| 95 if (context_provider()) | 95 if (context_provider()) |
| 96 context_provider()->SetLostContextCallback(base::Closure()); | 96 context_provider()->SetLostContextCallback(base::Closure()); |
| 97 | 97 |
| 98 // Avoid initializing GL context here, as this should be sharing the | 98 // Avoid initializing GL context here, as this should be sharing the |
| 99 // Display's context. | 99 // Display's context. |
| 100 display_->Initialize(this); | 100 display_->Initialize(this, surface_manager_, |
| 101 surface_id_allocator_->client_id()); |
| 101 return true; | 102 return true; |
| 102 } | 103 } |
| 103 | 104 |
| 104 void SurfaceDisplayOutputSurface::ForceReclaimResources() { | 105 void SurfaceDisplayOutputSurface::ForceReclaimResources() { |
| 105 if (!delegated_surface_id_.is_null()) { | 106 if (!delegated_surface_id_.is_null()) { |
| 106 factory_.SubmitCompositorFrame(delegated_surface_id_, CompositorFrame(), | 107 factory_.SubmitCompositorFrame(delegated_surface_id_, CompositorFrame(), |
| 107 SurfaceFactory::DrawCallback()); | 108 SurfaceFactory::DrawCallback()); |
| 108 } | 109 } |
| 109 } | 110 } |
| 110 | 111 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 SetMemoryPolicy(policy); | 156 SetMemoryPolicy(policy); |
| 156 } | 157 } |
| 157 | 158 |
| 158 void SurfaceDisplayOutputSurface::SwapBuffersComplete(SurfaceDrawStatus drawn) { | 159 void SurfaceDisplayOutputSurface::SwapBuffersComplete(SurfaceDrawStatus drawn) { |
| 159 // TODO(danakj): Why the lost check? | 160 // TODO(danakj): Why the lost check? |
| 160 if (!output_surface_lost_) | 161 if (!output_surface_lost_) |
| 161 client_->DidSwapBuffersComplete(); | 162 client_->DidSwapBuffersComplete(); |
| 162 } | 163 } |
| 163 | 164 |
| 164 } // namespace cc | 165 } // namespace cc |
| OLD | NEW |