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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 surface_id_ = allocator_.GenerateId(); | 43 surface_id_ = allocator_.GenerateId(); |
44 factory_.Create(surface_id_, frame_size); | 44 factory_.Create(surface_id_, frame_size); |
45 display_size_ = frame_size; | 45 display_size_ = frame_size; |
46 display_->Resize(surface_id_, frame_size); | 46 display_->Resize(surface_id_, frame_size); |
47 } | 47 } |
48 | 48 |
49 scoped_ptr<cc::CompositorFrame> frame_copy(new cc::CompositorFrame()); | 49 scoped_ptr<cc::CompositorFrame> frame_copy(new cc::CompositorFrame()); |
50 frame->AssignTo(frame_copy.get()); | 50 frame->AssignTo(frame_copy.get()); |
51 factory_.SubmitFrame(surface_id_, frame_copy.Pass()); | 51 factory_.SubmitFrame(surface_id_, frame_copy.Pass()); |
52 | 52 |
53 if (!display_->Draw()) | |
54 return; | |
55 | |
56 client_->DidSwapBuffers(); | 53 client_->DidSwapBuffers(); |
57 client_->DidSwapBuffersComplete(); | 54 client_->DidSwapBuffersComplete(); |
58 } | 55 } |
59 | 56 |
60 void SurfaceDisplayOutputSurface::ReturnResources( | 57 void SurfaceDisplayOutputSurface::ReturnResources( |
61 const cc::ReturnedResourceArray& resources) { | 58 const cc::ReturnedResourceArray& resources) { |
62 cc::CompositorFrameAck ack; | 59 cc::CompositorFrameAck ack; |
63 ack.resources = resources; | 60 ack.resources = resources; |
64 if (client_) | 61 if (client_) |
65 client_->ReclaimResources(&ack); | 62 client_->ReclaimResources(&ack); |
66 } | 63 } |
67 | 64 |
68 } // namespace content | 65 } // namespace content |
OLD | NEW |