Upstream version 11.39.266.0
[platform/framework/web/crosswalk.git] / src / ui / gl / android / surface_texture_tracker.h
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
3 // found in the LICENSE file.
4
5 #ifndef UI_GL_ANDROID_SURFACE_TEXTURE_TRACKER_H_
6 #define UI_GL_ANDROID_SURFACE_TEXTURE_TRACKER_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "ui/gl/gl_export.h"
10
11 namespace gfx {
12
13 class SurfaceTexture;
14
15 // This interface is used to take ownership of preallocated surface textures
16 // with specific ids.
17 class GL_EXPORT SurfaceTextureTracker {
18  public:
19   static SurfaceTextureTracker* GetInstance();
20   static void InitInstance(SurfaceTextureTracker* tracker);
21
22   virtual scoped_refptr<SurfaceTexture> AcquireSurfaceTexture(
23       int primary_id,
24       int secondary_id) = 0;
25
26  protected:
27   virtual ~SurfaceTextureTracker() {}
28 };
29
30 }  // namespace gfx
31
32 #endif  // UI_GL_ANDROID_SURFACE_TEXTURE_TRACKER_H_