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

Side by Side Diff: ui/gl/gl_context.h

Issue 1420533009: Cleanup GpuMemoryManager and helpers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more cleanup. Created 5 years, 1 month 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
« no previous file with comments | « gpu/command_buffer/service/gl_context_virtual.cc ('k') | ui/gl/gl_context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_GL_GL_CONTEXT_H_ 5 #ifndef UI_GL_GL_CONTEXT_H_
6 #define UI_GL_GL_CONTEXT_H_ 6 #define UI_GL_GL_CONTEXT_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // Set swap interval. This context must be current. 67 // Set swap interval. This context must be current.
68 void SetSwapInterval(int interval); 68 void SetSwapInterval(int interval);
69 69
70 // Forces the swap interval to zero (no vsync) regardless of any future values 70 // Forces the swap interval to zero (no vsync) regardless of any future values
71 // passed to SetSwapInterval. 71 // passed to SetSwapInterval.
72 void ForceSwapIntervalZero(bool force); 72 void ForceSwapIntervalZero(bool force);
73 73
74 // Returns space separated list of extensions. The context must be current. 74 // Returns space separated list of extensions. The context must be current.
75 virtual std::string GetExtensions(); 75 virtual std::string GetExtensions();
76 76
77 // Returns in bytes the total amount of GPU memory for the GPU which this
78 // context is currently rendering on. Returns false if no extension exists
79 // to get the exact amount of GPU memory.
80 virtual bool GetTotalGpuMemory(size_t* bytes);
81
82 // Indicate that it is safe to force this context to switch GPUs, since 77 // Indicate that it is safe to force this context to switch GPUs, since
83 // transitioning can cause corruption and hangs (OS X only). 78 // transitioning can cause corruption and hangs (OS X only).
84 virtual void SetSafeToForceGpuSwitch(); 79 virtual void SetSafeToForceGpuSwitch();
85 80
86 // Attempt to force the context to move to the GPU of its sharegroup. Return 81 // Attempt to force the context to move to the GPU of its sharegroup. Return
87 // false only in the event of an unexpected error on the context. 82 // false only in the event of an unexpected error on the context.
88 virtual bool ForceGpuSwitchIfNeeded(); 83 virtual bool ForceGpuSwitchIfNeeded();
89 84
90 // Indicate that the real context switches should unbind the FBO first 85 // Indicate that the real context switches should unbind the FBO first
91 // (For an Android work-around only). 86 // (For an Android work-around only).
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 void SetCurrent(GLSurface* surface) override; 199 void SetCurrent(GLSurface* surface) override;
205 200
206 private: 201 private:
207 scoped_ptr<gfx::GPUTiming> gpu_timing_; 202 scoped_ptr<gfx::GPUTiming> gpu_timing_;
208 DISALLOW_COPY_AND_ASSIGN(GLContextReal); 203 DISALLOW_COPY_AND_ASSIGN(GLContextReal);
209 }; 204 };
210 205
211 } // namespace gfx 206 } // namespace gfx
212 207
213 #endif // UI_GL_GL_CONTEXT_H_ 208 #endif // UI_GL_GL_CONTEXT_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gl_context_virtual.cc ('k') | ui/gl/gl_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698