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();
31 Key
PushBack(RendererType view
);
33 // |key| must be already in manager. Move renderer corresponding to |key| to
35 void DidDrawGL(Key key
);
39 RendererType
GetMostRecentlyDrawn() const;
42 friend struct base::DefaultLazyInstanceTraits
<GLViewRendererManager
>;
44 GLViewRendererManager();
45 ~GLViewRendererManager();
47 mutable base::Lock lock_
;
50 DISALLOW_COPY_AND_ASSIGN(GLViewRendererManager
);
53 } // namespace android_webview
55 #endif // ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_