Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Side by Side Diff: android_webview/browser/scoped_app_gl_state_restore.h

Issue 25082006: [Android WebView] OnMemoryPressure to drop tile memory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: real working code Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include <vector> 5 #include <vector>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "ui/gl/gl_bindings.h" 8 #include "ui/gl/gl_bindings.h"
9 9
10 namespace gfx { 10 namespace gfx {
11 class GLContext; 11 class GLContext;
12 } 12 }
13 13
14 namespace android_webview { 14 namespace android_webview {
15 15
16 // This class is not thread safe and should only be used on the UI thread. 16 // This class is not thread safe and should only be used on the UI thread.
17 class ScopedAppGLStateRestore { 17 class ScopedAppGLStateRestore {
18 public: 18 public:
19 enum CallMode { 19 enum CallMode {
20 MODE_DRAW, 20 MODE_DRAW,
21 MODE_DETACH_FROM_WINDOW 21 MODE_DETACH_FROM_WINDOW,
22 MODE_ON_TRIM
joth 2013/10/02 10:47:01 nit: include the trailing comma on last item as d
boliu 2013/10/02 14:09:55 both done
22 }; 23 };
23 24
24 ScopedAppGLStateRestore(CallMode mode); 25 ScopedAppGLStateRestore(CallMode mode);
25 ~ScopedAppGLStateRestore(); 26 ~ScopedAppGLStateRestore();
26 27
27 bool stencil_enabled() const { return stencil_test_; } 28 bool stencil_enabled() const { return stencil_test_; }
28 GLint framebuffer_binding_ext() const { return framebuffer_binding_ext_; } 29 GLint framebuffer_binding_ext() const { return framebuffer_binding_ext_; }
29 30
30 private: 31 private:
31 const CallMode mode_; 32 const CallMode mode_;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 GLint texture_external_oes; 93 GLint texture_external_oes;
93 // TODO(boliu): TEXTURE_RECTANGLE_ARB 94 // TODO(boliu): TEXTURE_RECTANGLE_ARB
94 }; 95 };
95 96
96 std::vector<TextureBindings> texture_bindings_; 97 std::vector<TextureBindings> texture_bindings_;
97 98
98 DISALLOW_COPY_AND_ASSIGN(ScopedAppGLStateRestore); 99 DISALLOW_COPY_AND_ASSIGN(ScopedAppGLStateRestore);
99 }; 100 };
100 101
101 } // namespace android_webview 102 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698