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/delegated_frame_host.h" | 5 #include "content/browser/compositor/delegated_frame_host.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
10 #include "cc/output/compositor_frame_ack.h" | 10 #include "cc/output/compositor_frame_ack.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 ui::Compositor* compositor = client_->GetCompositor(); | 124 ui::Compositor* compositor = client_->GetCompositor(); |
125 if (!compositor) | 125 if (!compositor) |
126 return false; | 126 return false; |
127 | 127 |
128 return true; | 128 return true; |
129 } | 129 } |
130 | 130 |
131 void DelegatedFrameHost::RequestCopyOfOutput( | 131 void DelegatedFrameHost::RequestCopyOfOutput( |
132 scoped_ptr<cc::CopyOutputRequest> request) { | 132 scoped_ptr<cc::CopyOutputRequest> request) { |
133 if (use_surfaces_) { | 133 if (use_surfaces_) { |
134 // TODO(jbauman): Make this work with surfaces. | 134 if (surface_factory_ && !surface_id_.is_null()) |
135 request->SendEmptyResult(); | 135 surface_factory_->RequestCopyOfSurface(surface_id_, request.Pass()); |
| 136 else |
| 137 request->SendEmptyResult(); |
136 } else { | 138 } else { |
137 client_->GetLayer()->RequestCopyOfOutput(request.Pass()); | 139 client_->GetLayer()->RequestCopyOfOutput(request.Pass()); |
138 } | 140 } |
139 } | 141 } |
140 | 142 |
141 void DelegatedFrameHost::CopyFromCompositingSurface( | 143 void DelegatedFrameHost::CopyFromCompositingSurface( |
142 const gfx::Rect& src_subrect, | 144 const gfx::Rect& src_subrect, |
143 const gfx::Size& output_size, | 145 const gfx::Size& output_size, |
144 const base::Callback<void(bool, const SkBitmap&)>& callback, | 146 const base::Callback<void(bool, const SkBitmap&)>& callback, |
145 const SkColorType color_type) { | 147 const SkColorType color_type) { |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 if (frame_provider_.get()) { | 974 if (frame_provider_.get()) { |
973 new_layer->SetShowDelegatedContent(frame_provider_.get(), | 975 new_layer->SetShowDelegatedContent(frame_provider_.get(), |
974 current_frame_size_in_dip_); | 976 current_frame_size_in_dip_); |
975 } | 977 } |
976 if (!surface_id_.is_null()) { | 978 if (!surface_id_.is_null()) { |
977 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_); | 979 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_); |
978 } | 980 } |
979 } | 981 } |
980 | 982 |
981 } // namespace content | 983 } // namespace content |
OLD | NEW |