Chromium Code Reviews| 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.h" | 5 #include "cc/surfaces/surface.h" |
| 6 | 6 |
| 7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
| 8 #include "cc/output/copy_output_request.h" | 8 #include "cc/output/copy_output_request.h" |
| 9 #include "cc/surfaces/surface_factory.h" | 9 #include "cc/surfaces/surface_factory.h" |
| 10 #include "cc/surfaces/surface_manager.h" | |
| 10 | 11 |
| 11 namespace cc { | 12 namespace cc { |
| 12 | 13 |
| 13 // The frame index starts at 2 so that empty frames will be treated as | 14 // The frame index starts at 2 so that empty frames will be treated as |
| 14 // completely damaged the first time they're drawn from. | 15 // completely damaged the first time they're drawn from. |
| 15 static const int kFrameIndexStart = 2; | 16 static const int kFrameIndexStart = 2; |
| 16 | 17 |
| 17 Surface::Surface(SurfaceId id, const gfx::Size& size, SurfaceFactory* factory) | 18 Surface::Surface(SurfaceId id, const gfx::Size& size, SurfaceFactory* factory) |
| 18 : surface_id_(id), | 19 : surface_id_(id), |
| 19 size_(size), | 20 size_(size), |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 43 if (previous_frame) { | 44 if (previous_frame) { |
| 44 ReturnedResourceArray previous_resources; | 45 ReturnedResourceArray previous_resources; |
| 45 TransferableResource::ReturnResources( | 46 TransferableResource::ReturnResources( |
| 46 previous_frame->delegated_frame_data->resource_list, | 47 previous_frame->delegated_frame_data->resource_list, |
| 47 &previous_resources); | 48 &previous_resources); |
| 48 factory_->UnrefResources(previous_resources); | 49 factory_->UnrefResources(previous_resources); |
| 49 } | 50 } |
| 50 if (!draw_callback_.is_null()) | 51 if (!draw_callback_.is_null()) |
| 51 draw_callback_.Run(); | 52 draw_callback_.Run(); |
| 52 draw_callback_ = callback; | 53 draw_callback_ = callback; |
| 54 factory_->manager()->SatisfiesSequence( | |
|
jamesr
2014/09/12 01:08:55
the grammar here is a lil' weird. How about "DidS
| |
| 55 surface_id_, ¤t_frame_->metadata.satisfies_sequence); | |
| 53 } | 56 } |
| 54 | 57 |
| 55 void Surface::RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> copy_request) { | 58 void Surface::RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> copy_request) { |
| 56 // TODO(jbauman): Make this work. | 59 // TODO(jbauman): Make this work. |
| 57 copy_request->SendEmptyResult(); | 60 copy_request->SendEmptyResult(); |
| 58 } | 61 } |
| 59 | 62 |
| 60 const CompositorFrame* Surface::GetEligibleFrame() { | 63 const CompositorFrame* Surface::GetEligibleFrame() { |
| 61 return current_frame_.get(); | 64 return current_frame_.get(); |
| 62 } | 65 } |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 76 | 79 |
| 77 void Surface::RunDrawCallbacks() { | 80 void Surface::RunDrawCallbacks() { |
| 78 if (!draw_callback_.is_null()) { | 81 if (!draw_callback_.is_null()) { |
| 79 base::Closure callback = draw_callback_; | 82 base::Closure callback = draw_callback_; |
| 80 draw_callback_ = base::Closure(); | 83 draw_callback_ = base::Closure(); |
| 81 callback.Run(); | 84 callback.Run(); |
| 82 } | 85 } |
| 83 } | 86 } |
| 84 | 87 |
| 85 } // namespace cc | 88 } // namespace cc |
| OLD | NEW |