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. 4 5 #ifndef ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_ 6 #define ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_ 7 8 #include <list> 9 10 #include "base/basictypes.h" 11 12 namespace android_webview { 13 14 class BrowserViewRenderer; 15 16 class GLViewRendererManager { 17 typedef std::list<BrowserViewRenderer*> ListType; 18 public: 19 typedef ListType::iterator Key; 20 21 GLViewRendererManager(); 22 ~GLViewRendererManager(); 23 24 // If |key| is NullKey(), then |view| is inserted at the front and a new key 25 // is returned. Otherwise |key| must point to |view| which is moved to the 26 // front. 27 Key DidDrawGL(Key key, BrowserViewRenderer* view); 28 29 void NoLongerExpectsDrawGL(Key key); 30 31 BrowserViewRenderer* GetMostRecentlyDrawn() const; 32 33 Key NullKey(); 34 35 private: 36 ListType mru_list_; 37 38 DISALLOW_COPY_AND_ASSIGN(GLViewRendererManager); 39 }; 40 41 } // namespace android_webview 42 43 #endif // ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_ 44