| 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() { |
| 32 return mru_list_.end(); |
| 33 } |
| 34 |
| 31 Key PushBack(RendererType view); | 35 Key PushBack(RendererType view); |
| 32 | 36 |
| 33 // |key| must be already in manager. Move renderer corresponding to |key| to | 37 // |key| must be already in manager. Move renderer corresponding to |key| to |
| 34 // most recent. | 38 // most recent. |
| 35 void DidDrawGL(Key key); | 39 void DidDrawGL(Key key); |
| 36 | 40 |
| 37 void Remove(Key key); | 41 void Remove(Key key); |
| 38 | 42 |
| 39 RendererType GetMostRecentlyDrawn() const; | 43 RendererType GetMostRecentlyDrawn() const; |
| 40 | 44 |
| 41 private: | 45 private: |
| 42 friend struct base::DefaultLazyInstanceTraits<GLViewRendererManager>; | 46 friend struct base::DefaultLazyInstanceTraits<GLViewRendererManager>; |
| 43 | 47 |
| 44 GLViewRendererManager(); | 48 GLViewRendererManager(); |
| 45 ~GLViewRendererManager(); | 49 ~GLViewRendererManager(); |
| 46 | 50 |
| 47 mutable base::Lock lock_; | 51 mutable base::Lock lock_; |
| 48 ListType mru_list_; | 52 ListType mru_list_; |
| 49 | 53 |
| 50 DISALLOW_COPY_AND_ASSIGN(GLViewRendererManager); | 54 DISALLOW_COPY_AND_ASSIGN(GLViewRendererManager); |
| 51 }; | 55 }; |
| 52 | 56 |
| 53 } // namespace android_webview | 57 } // namespace android_webview |
| 54 | 58 |
| 55 #endif // ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_ | 59 #endif // ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_ |
| OLD | NEW |