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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 return true; | 116 return true; |
117 #endif | 117 #endif |
118 } | 118 } |
119 | 119 |
120 void DelegatedFrameHost::RequestCopyOfOutput( | 120 void DelegatedFrameHost::RequestCopyOfOutput( |
121 scoped_ptr<cc::CopyOutputRequest> request) { | 121 scoped_ptr<cc::CopyOutputRequest> request) { |
122 client_->GetLayer()->RequestCopyOfOutput(request.Pass()); | 122 client_->GetLayer()->RequestCopyOfOutput(request.Pass()); |
123 } | 123 } |
124 | 124 |
125 gfx::Rect DelegatedFrameHost::GetViewBoundsWithResizeLock( | |
126 const gfx::Rect& bounds) const { | |
127 if (resize_lock_.get()) | |
128 return gfx::Rect(bounds.origin(), resize_lock_->expected_size()); | |
129 else | |
130 return bounds; | |
131 } | |
132 | |
133 void DelegatedFrameHost::CopyFromCompositingSurface( | 125 void DelegatedFrameHost::CopyFromCompositingSurface( |
134 const gfx::Rect& src_subrect, | 126 const gfx::Rect& src_subrect, |
135 const gfx::Size& dst_size, | 127 const gfx::Size& dst_size, |
136 const base::Callback<void(bool, const SkBitmap&)>& callback, | 128 const base::Callback<void(bool, const SkBitmap&)>& callback, |
137 const SkBitmap::Config config) { | 129 const SkBitmap::Config config) { |
138 // Only ARGB888 and RGB565 supported as of now. | 130 // Only ARGB888 and RGB565 supported as of now. |
139 bool format_support = ((config == SkBitmap::kRGB_565_Config) || | 131 bool format_support = ((config == SkBitmap::kRGB_565_Config) || |
140 (config == SkBitmap::kARGB_8888_Config)); | 132 (config == SkBitmap::kARGB_8888_Config)); |
141 if (!format_support) { | 133 if (!format_support) { |
142 DCHECK(format_support); | 134 DCHECK(format_support); |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 // that should keep our frame. old_layer will be returned to the | 861 // that should keep our frame. old_layer will be returned to the |
870 // RecreateLayer caller, and should have a copy. | 862 // RecreateLayer caller, and should have a copy. |
871 if (frame_provider_.get()) { | 863 if (frame_provider_.get()) { |
872 new_layer->SetShowDelegatedContent(frame_provider_.get(), | 864 new_layer->SetShowDelegatedContent(frame_provider_.get(), |
873 current_frame_size_in_dip_); | 865 current_frame_size_in_dip_); |
874 } | 866 } |
875 } | 867 } |
876 | 868 |
877 } // namespace content | 869 } // namespace content |
878 | 870 |
OLD | NEW |