Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: ui/compositor/test/in_process_context_factory.cc

Issue 2791723003: Update GpuSurfaceTracker to include Android surfaces. (Closed)
Patch Set: updated comment Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/ipc/common/gpu_surface_tracker.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « gpu/ipc/common/gpu_surface_tracker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698