| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 } | 176 } |
| 177 | 177 |
| 178 scoped_ptr<cc::CopyOutputRequest> request = | 178 scoped_ptr<cc::CopyOutputRequest> request = |
| 179 cc::CopyOutputRequest::CreateRequest(base::Bind( | 179 cc::CopyOutputRequest::CreateRequest(base::Bind( |
| 180 &DelegatedFrameHost:: | 180 &DelegatedFrameHost:: |
| 181 CopyFromCompositingSurfaceHasResultForVideo, | 181 CopyFromCompositingSurfaceHasResultForVideo, |
| 182 AsWeakPtr(), // For caching the ReadbackYUVInterface on this class. | 182 AsWeakPtr(), // For caching the ReadbackYUVInterface on this class. |
| 183 subscriber_texture, | 183 subscriber_texture, |
| 184 target, | 184 target, |
| 185 callback)); | 185 callback)); |
| 186 gfx::Rect src_subrect_in_pixel = | 186 request->set_area(src_subrect); |
| 187 ConvertRectToPixel(client_->CurrentDeviceScaleFactor(), src_subrect); | |
| 188 request->set_area(src_subrect_in_pixel); | |
| 189 if (subscriber_texture.get()) { | 187 if (subscriber_texture.get()) { |
| 190 request->SetTextureMailbox( | 188 request->SetTextureMailbox( |
| 191 cc::TextureMailbox(subscriber_texture->mailbox(), | 189 cc::TextureMailbox(subscriber_texture->mailbox(), |
| 192 subscriber_texture->target(), | 190 subscriber_texture->target(), |
| 193 subscriber_texture->sync_point())); | 191 subscriber_texture->sync_point())); |
| 194 } | 192 } |
| 195 client_->RequestCopyOfOutput(request.Pass()); | 193 client_->RequestCopyOfOutput(request.Pass()); |
| 196 } | 194 } |
| 197 | 195 |
| 198 bool DelegatedFrameHost::CanCopyToBitmap() const { | 196 bool DelegatedFrameHost::CanCopyToBitmap() const { |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 918 if (frame_provider_.get()) { | 916 if (frame_provider_.get()) { |
| 919 new_layer->SetShowDelegatedContent(frame_provider_.get(), | 917 new_layer->SetShowDelegatedContent(frame_provider_.get(), |
| 920 current_frame_size_in_dip_); | 918 current_frame_size_in_dip_); |
| 921 } | 919 } |
| 922 if (!surface_id_.is_null()) { | 920 if (!surface_id_.is_null()) { |
| 923 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_); | 921 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_); |
| 924 } | 922 } |
| 925 } | 923 } |
| 926 | 924 |
| 927 } // namespace content | 925 } // namespace content |
| OLD | NEW |