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 #ifndef ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_
6 #define ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_
10 #include "base/basictypes.h"
11 #include "base/lazy_instance.h"
12 #include "base/synchronization/lock.h"
13 #include "base/threading/platform_thread.h"
15 namespace android_webview
{
17 class SharedRendererState
;
19 class GLViewRendererManager
{
21 typedef SharedRendererState
* RendererType
;
24 typedef std::list
<RendererType
> ListType
;
27 typedef ListType::iterator Key
;
29 static GLViewRendererManager
* GetInstance();
33 Key
PushBack(RendererType view
);
35 // |key| must be already in manager. Move renderer corresponding to |key| to
37 void DidDrawGL(Key key
);
41 RendererType
GetMostRecentlyDrawn() const;
44 friend struct base::DefaultLazyInstanceTraits
<GLViewRendererManager
>;
46 GLViewRendererManager();
47 ~GLViewRendererManager();
49 mutable base::Lock lock_
;
52 DISALLOW_COPY_AND_ASSIGN(GLViewRendererManager
);
55 } // namespace android_webview
57 #endif // ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_