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 "ui/compositor/test/in_process_context_factory.h" | 5 #include "ui/compositor/test/in_process_context_factory.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 gfx::AcceleratedWidget widget = compositor->widget(); | 325 gfx::AcceleratedWidget widget = compositor->widget(); |
326 | 326 |
327 auto data = base::MakeUnique<PerCompositorData>(); | 327 auto data = base::MakeUnique<PerCompositorData>(); |
328 if (widget == gfx::kNullAcceleratedWidget) { | 328 if (widget == gfx::kNullAcceleratedWidget) { |
329 data->surface_handle = gpu::kNullSurfaceHandle; | 329 data->surface_handle = gpu::kNullSurfaceHandle; |
330 } else { | 330 } else { |
331 #if defined(GPU_SURFACE_HANDLE_IS_ACCELERATED_WINDOW) | 331 #if defined(GPU_SURFACE_HANDLE_IS_ACCELERATED_WINDOW) |
332 data->surface_handle = widget; | 332 data->surface_handle = widget; |
333 #else | 333 #else |
334 gpu::GpuSurfaceTracker* tracker = gpu::GpuSurfaceTracker::Get(); | 334 gpu::GpuSurfaceTracker* tracker = gpu::GpuSurfaceTracker::Get(); |
335 data->surface_handle = tracker->AddSurfaceForNativeWidget(widget); | 335 data->surface_handle = tracker->AddSurfaceForNativeWidget( |
| 336 gpu::GpuSurfaceTracker::SurfaceRecord( |
| 337 widget |
| 338 #if defined(OS_ANDROID) |
| 339 // We have to provide a surface too, but we don't have one. For |
| 340 // now, we don't proide it, since nobody should ask anyway. |
| 341 // If we ever provide a valid surface here, then GpuSurfaceTracker |
| 342 // can be more strict about enforcing it. |
| 343 , |
| 344 nullptr |
| 345 #endif |
| 346 )); |
336 #endif | 347 #endif |
337 } | 348 } |
338 | 349 |
339 PerCompositorData* return_ptr = data.get(); | 350 PerCompositorData* return_ptr = data.get(); |
340 per_compositor_data_[compositor] = std::move(data); | 351 per_compositor_data_[compositor] = std::move(data); |
341 return return_ptr; | 352 return return_ptr; |
342 } | 353 } |
343 | 354 |
344 } // namespace ui | 355 } // namespace ui |
OLD | NEW |