summaryrefslogtreecommitdiffstats
path: root/ui/gl/async_pixel_transfer_delegate_linux.cc
diff options
context:
space:
mode:
authorreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-25 20:20:21 +0000
committerreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-25 20:20:21 +0000
commit373cfd0c762ad235950edeae87ee757e613d5d0f (patch)
treeb6d981322e93bb15e0baf2182df714198397f817 /ui/gl/async_pixel_transfer_delegate_linux.cc
parentedd22f92ef9384c36d01329f426d28dd0f09914c (diff)
downloadchromium_src-373cfd0c762ad235950edeae87ee757e613d5d0f.zip
chromium_src-373cfd0c762ad235950edeae87ee757e613d5d0f.tar.gz
chromium_src-373cfd0c762ad235950edeae87ee757e613d5d0f.tar.bz2
ui: Improve instantiation of AsyncPixelTransferDelegate classes.
Add proper platform abstraction for async pixel transfer interface by moving android implementation into _egl.cc, current stub implementation into _sync.cc and add platform specific files that decide what implementation to use. BUG=187886 TEST=gpu_unittests Review URL: https://chromiumcodereview.appspot.com/14471013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196474 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl/async_pixel_transfer_delegate_linux.cc')
-rw-r--r--ui/gl/async_pixel_transfer_delegate_linux.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/ui/gl/async_pixel_transfer_delegate_linux.cc b/ui/gl/async_pixel_transfer_delegate_linux.cc
new file mode 100644
index 0000000..6eb8021
--- /dev/null
+++ b/ui/gl/async_pixel_transfer_delegate_linux.cc
@@ -0,0 +1,30 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/gl/async_pixel_transfer_delegate.h"
+
+#include "base/debug/trace_event.h"
+#include "ui/gl/async_pixel_transfer_delegate_idle.h"
+#include "ui/gl/async_pixel_transfer_delegate_stub.h"
+#include "ui/gl/gl_implementation.h"
+
+namespace gfx {
+
+AsyncPixelTransferDelegate* AsyncPixelTransferDelegate::Create(
+ gfx::GLContext* context) {
+ TRACE_EVENT0("gpu", "AsyncPixelTransferDelegate::Create");
+ switch (GetGLImplementation()) {
+ case kGLImplementationOSMesaGL:
+ case kGLImplementationDesktopGL:
+ case kGLImplementationEGLGLES2:
+ return new AsyncPixelTransferDelegateIdle;
+ case kGLImplementationMockGL:
+ return new AsyncPixelTransferDelegateStub;
+ default:
+ NOTREACHED();
+ return NULL;
+ }
+}
+
+} // namespace gfx