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 <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 } | 200 } |
201 | 201 |
202 uint32_t DelegatedFrameHost::GetSurfaceIdNamespace() { | 202 uint32_t DelegatedFrameHost::GetSurfaceIdNamespace() { |
203 if (!use_surfaces_) | 203 if (!use_surfaces_) |
204 return 0; | 204 return 0; |
205 | 205 |
206 return id_allocator_->id_namespace(); | 206 return id_allocator_->id_namespace(); |
207 } | 207 } |
208 | 208 |
209 cc::SurfaceId DelegatedFrameHost::SurfaceIdAtPoint( | 209 cc::SurfaceId DelegatedFrameHost::SurfaceIdAtPoint( |
| 210 cc::SurfaceHittestDelegate* delegate, |
210 const gfx::Point& point, | 211 const gfx::Point& point, |
211 gfx::Point* transformed_point) { | 212 gfx::Point* transformed_point) { |
212 if (surface_id_.is_null()) | 213 if (surface_id_.is_null()) |
213 return surface_id_; | 214 return surface_id_; |
214 cc::SurfaceHittest hittest(nullptr, GetSurfaceManager()); | 215 cc::SurfaceHittest hittest(delegate, GetSurfaceManager()); |
215 gfx::Transform target_transform; | 216 gfx::Transform target_transform; |
216 cc::SurfaceId target_surface_id = | 217 cc::SurfaceId target_surface_id = |
217 hittest.GetTargetSurfaceAtPoint(surface_id_, point, &target_transform); | 218 hittest.GetTargetSurfaceAtPoint(surface_id_, point, &target_transform); |
218 *transformed_point = point; | 219 *transformed_point = point; |
219 if (!target_surface_id.is_null()) | 220 if (!target_surface_id.is_null()) |
220 target_transform.TransformPoint(transformed_point); | 221 target_transform.TransformPoint(transformed_point); |
221 return target_surface_id; | 222 return target_surface_id; |
222 } | 223 } |
223 | 224 |
224 void DelegatedFrameHost::TransformPointToLocalCoordSpace( | 225 void DelegatedFrameHost::TransformPointToLocalCoordSpace( |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 cc::SurfaceManager* manager = factory->GetSurfaceManager(); | 1079 cc::SurfaceManager* manager = factory->GetSurfaceManager(); |
1079 new_layer->SetShowSurface( | 1080 new_layer->SetShowSurface( |
1080 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), | 1081 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), |
1081 base::Bind(&RequireCallback, base::Unretained(manager)), | 1082 base::Bind(&RequireCallback, base::Unretained(manager)), |
1082 current_surface_size_, current_scale_factor_, | 1083 current_surface_size_, current_scale_factor_, |
1083 current_frame_size_in_dip_); | 1084 current_frame_size_in_dip_); |
1084 } | 1085 } |
1085 } | 1086 } |
1086 | 1087 |
1087 } // namespace content | 1088 } // namespace content |
OLD | NEW |