OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_ |
6 #define ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 typedef SharedRendererState* RendererType; | 21 typedef SharedRendererState* RendererType; |
22 | 22 |
23 private: | 23 private: |
24 typedef std::list<RendererType> ListType; | 24 typedef std::list<RendererType> ListType; |
25 | 25 |
26 public: | 26 public: |
27 typedef ListType::iterator Key; | 27 typedef ListType::iterator Key; |
28 | 28 |
29 static GLViewRendererManager* GetInstance(); | 29 static GLViewRendererManager* GetInstance(); |
30 | 30 |
31 Key NullKey() { | 31 Key NullKey(); |
32 return mru_list_.end(); | |
33 } | |
34 | 32 |
35 Key PushBack(RendererType view); | 33 Key PushBack(RendererType view); |
36 | 34 |
37 // |key| must be already in manager. Move renderer corresponding to |key| to | 35 // |key| must be already in manager. Move renderer corresponding to |key| to |
38 // most recent. | 36 // most recent. |
39 void DidDrawGL(Key key); | 37 void DidDrawGL(Key key); |
40 | 38 |
41 void Remove(Key key); | 39 void Remove(Key key); |
42 | 40 |
43 RendererType GetMostRecentlyDrawn() const; | 41 RendererType GetMostRecentlyDrawn() const; |
44 | 42 |
45 private: | 43 private: |
46 friend struct base::DefaultLazyInstanceTraits<GLViewRendererManager>; | 44 friend struct base::DefaultLazyInstanceTraits<GLViewRendererManager>; |
47 | 45 |
48 GLViewRendererManager(); | 46 GLViewRendererManager(); |
49 ~GLViewRendererManager(); | 47 ~GLViewRendererManager(); |
50 | 48 |
51 mutable base::Lock lock_; | 49 mutable base::Lock lock_; |
52 ListType mru_list_; | 50 ListType mru_list_; |
53 | 51 |
54 DISALLOW_COPY_AND_ASSIGN(GLViewRendererManager); | 52 DISALLOW_COPY_AND_ASSIGN(GLViewRendererManager); |
55 }; | 53 }; |
56 | 54 |
57 } // namespace android_webview | 55 } // namespace android_webview |
58 | 56 |
59 #endif // ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_ | 57 #endif // ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_ |
OLD | NEW |