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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 else | 136 else |
137 request->SendEmptyResult(); | 137 request->SendEmptyResult(); |
138 } else { | 138 } else { |
139 client_->GetLayer()->RequestCopyOfOutput(request.Pass()); | 139 client_->GetLayer()->RequestCopyOfOutput(request.Pass()); |
140 } | 140 } |
141 } | 141 } |
142 | 142 |
143 void DelegatedFrameHost::CopyFromCompositingSurface( | 143 void DelegatedFrameHost::CopyFromCompositingSurface( |
144 const gfx::Rect& src_subrect, | 144 const gfx::Rect& src_subrect, |
145 const gfx::Size& output_size, | 145 const gfx::Size& output_size, |
146 const base::Callback<void(bool, const SkBitmap&)>& callback, | 146 CompletionCallback& callback, |
147 const SkColorType color_type) { | 147 const SkColorType color_type) { |
148 // Only ARGB888 and RGB565 supported as of now. | 148 // Only ARGB888 and RGB565 supported as of now. |
149 bool format_support = ((color_type == kAlpha_8_SkColorType) || | 149 bool format_support = ((color_type == kAlpha_8_SkColorType) || |
150 (color_type == kRGB_565_SkColorType) || | 150 (color_type == kRGB_565_SkColorType) || |
151 (color_type == kN32_SkColorType)); | 151 (color_type == kN32_SkColorType)); |
152 DCHECK(format_support); | 152 DCHECK(format_support); |
153 if (!CanCopyToBitmap()) { | 153 if (!CanCopyToBitmap()) { |
154 callback.Run(false, SkBitmap()); | 154 callback.Run(false, SkBitmap()); |
155 return; | 155 return; |
156 } | 156 } |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 if (frame_provider_.get()) { | 976 if (frame_provider_.get()) { |
977 new_layer->SetShowDelegatedContent(frame_provider_.get(), | 977 new_layer->SetShowDelegatedContent(frame_provider_.get(), |
978 current_frame_size_in_dip_); | 978 current_frame_size_in_dip_); |
979 } | 979 } |
980 if (!surface_id_.is_null()) { | 980 if (!surface_id_.is_null()) { |
981 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_); | 981 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_); |
982 } | 982 } |
983 } | 983 } |
984 | 984 |
985 } // namespace content | 985 } // namespace content |
OLD | NEW |