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