| 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 "content/browser/compositor/surface_display_output_surface.h" | 5 #include "content/browser/compositor/surface_display_output_surface.h" |
| 6 | 6 |
| 7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
| 8 #include "cc/output/compositor_frame_ack.h" | 8 #include "cc/output/compositor_frame_ack.h" |
| 9 #include "cc/surfaces/display.h" | 9 #include "cc/surfaces/display.h" |
| 10 #include "cc/surfaces/surface.h" | 10 #include "cc/surfaces/surface.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 base::Unretained(this))); | 62 base::Unretained(this))); |
| 63 | 63 |
| 64 client_->DidSwapBuffers(); | 64 client_->DidSwapBuffers(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 bool SurfaceDisplayOutputSurface::BindToClient( | 67 bool SurfaceDisplayOutputSurface::BindToClient( |
| 68 cc::OutputSurfaceClient* client) { | 68 cc::OutputSurfaceClient* client) { |
| 69 DCHECK(client); | 69 DCHECK(client); |
| 70 DCHECK(display_client_); | 70 DCHECK(display_client_); |
| 71 client_ = client; | 71 client_ = client; |
| 72 display_client_->Initialize(); | |
| 73 // Avoid initializing GL context here, as this should be sharing the | 72 // Avoid initializing GL context here, as this should be sharing the |
| 74 // Display's context. | 73 // Display's context. |
| 75 return true; | 74 return display_client_->Initialize(); |
| 76 } | 75 } |
| 77 | 76 |
| 78 void SurfaceDisplayOutputSurface::ReturnResources( | 77 void SurfaceDisplayOutputSurface::ReturnResources( |
| 79 const cc::ReturnedResourceArray& resources) { | 78 const cc::ReturnedResourceArray& resources) { |
| 80 cc::CompositorFrameAck ack; | 79 cc::CompositorFrameAck ack; |
| 81 ack.resources = resources; | 80 ack.resources = resources; |
| 82 if (client_) | 81 if (client_) |
| 83 client_->ReclaimResources(&ack); | 82 client_->ReclaimResources(&ack); |
| 84 } | 83 } |
| 85 | 84 |
| 86 void SurfaceDisplayOutputSurface::SwapBuffersComplete() { | 85 void SurfaceDisplayOutputSurface::SwapBuffersComplete() { |
| 87 client_->DidSwapBuffersComplete(); | 86 client_->DidSwapBuffersComplete(); |
| 88 } | 87 } |
| 89 | 88 |
| 90 } // namespace content | 89 } // namespace content |
| OLD | NEW |