Handle account removal correctly on all platforms.
[chromium-blink-merge.git] / gpu / command_buffer / service / async_pixel_transfer_manager_linux.cc
blob8d25f00a0e40e25c81d1bd943e82bb096e99da30
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
7 #include "base/command_line.h"
8 #include "base/debug/trace_event.h"
9 #include "gpu/command_buffer/service/async_pixel_transfer_manager_idle.h"
10 #include "gpu/command_buffer/service/async_pixel_transfer_manager_share_group.h"
11 #include "gpu/command_buffer/service/async_pixel_transfer_manager_stub.h"
12 #include "gpu/command_buffer/service/gpu_switches.h"
13 #include "ui/gl/gl_implementation.h"
15 namespace gpu {
17 AsyncPixelTransferManager* AsyncPixelTransferManager::Create(
18 gfx::GLContext* context) {
19 TRACE_EVENT0("gpu", "AsyncPixelTransferManager::Create");
20 if (CommandLine::ForCurrentProcess()->HasSwitch(
21 switches::kEnableShareGroupAsyncTextureUpload)) {
22 DCHECK(context);
23 return static_cast<AsyncPixelTransferManager*> (
24 new AsyncPixelTransferManagerShareGroup(context));
27 switch (gfx::GetGLImplementation()) {
28 case gfx::kGLImplementationOSMesaGL:
29 case gfx::kGLImplementationDesktopGL:
30 case gfx::kGLImplementationEGLGLES2:
31 return new AsyncPixelTransferManagerIdle;
32 case gfx::kGLImplementationMockGL:
33 return new AsyncPixelTransferManagerStub;
34 default:
35 NOTREACHED();
36 return NULL;
40 } // namespace gpu