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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 ui::Compositor* compositor = client_->GetCompositor(); | 121 ui::Compositor* compositor = client_->GetCompositor(); |
122 if (!compositor) | 122 if (!compositor) |
123 return false; | 123 return false; |
124 | 124 |
125 return true; | 125 return true; |
126 } | 126 } |
127 | 127 |
128 void DelegatedFrameHost::RequestCopyOfOutput( | 128 void DelegatedFrameHost::RequestCopyOfOutput( |
129 scoped_ptr<cc::CopyOutputRequest> request) { | 129 scoped_ptr<cc::CopyOutputRequest> request) { |
130 client_->GetLayer()->RequestCopyOfOutput(request.Pass()); | 130 if (use_surfaces_) { |
| 131 // TODO(jbauman): Make this work with surfaces. |
| 132 request->SendEmptyResult(); |
| 133 } else { |
| 134 client_->GetLayer()->RequestCopyOfOutput(request.Pass()); |
| 135 } |
131 } | 136 } |
132 | 137 |
133 void DelegatedFrameHost::CopyFromCompositingSurface( | 138 void DelegatedFrameHost::CopyFromCompositingSurface( |
134 const gfx::Rect& src_subrect, | 139 const gfx::Rect& src_subrect, |
135 const gfx::Size& output_size, | 140 const gfx::Size& output_size, |
136 const base::Callback<void(bool, const SkBitmap&)>& callback, | 141 const base::Callback<void(bool, const SkBitmap&)>& callback, |
137 const SkColorType color_type) { | 142 const SkColorType color_type) { |
138 // Only ARGB888 and RGB565 supported as of now. | 143 // Only ARGB888 and RGB565 supported as of now. |
139 bool format_support = ((color_type == kRGB_565_SkColorType) || | 144 bool format_support = ((color_type == kRGB_565_SkColorType) || |
140 (color_type == kN32_SkColorType)); | 145 (color_type == kN32_SkColorType)); |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 if (frame_provider_.get()) { | 936 if (frame_provider_.get()) { |
932 new_layer->SetShowDelegatedContent(frame_provider_.get(), | 937 new_layer->SetShowDelegatedContent(frame_provider_.get(), |
933 current_frame_size_in_dip_); | 938 current_frame_size_in_dip_); |
934 } | 939 } |
935 if (!surface_id_.is_null()) { | 940 if (!surface_id_.is_null()) { |
936 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_); | 941 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_); |
937 } | 942 } |
938 } | 943 } |
939 | 944 |
940 } // namespace content | 945 } // namespace content |
OLD | NEW |