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

Unified Diff: ui/gl/gl_context_cgl.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_context_cgl.h ('k') | ui/gl/gl_context_egl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_context_cgl.cc
diff --git a/ui/gl/gl_context_cgl.cc b/ui/gl/gl_context_cgl.cc
index 6de014ecde99341e6188705b22e98873555031e7..147e4b193daff0fcc6db1629bfd912460e3df567 100644
--- a/ui/gl/gl_context_cgl.cc
+++ b/ui/gl/gl_context_cgl.cc
@@ -259,59 +259,6 @@ void GLContextCGL::OnSetSwapInterval(int interval) {
DCHECK(IsCurrent(nullptr));
}
-bool GLContextCGL::GetTotalGpuMemory(size_t* bytes) {
- DCHECK(bytes);
- *bytes = 0;
-
- CGLContextObj context = reinterpret_cast<CGLContextObj>(context_);
- if (!context)
- return false;
-
- // Retrieve the current renderer ID
- GLint current_renderer_id = 0;
- if (CGLGetParameter(context,
- kCGLCPCurrentRendererID,
- &current_renderer_id) != kCGLNoError)
- return false;
-
- // Iterate through the list of all renderers
- GLuint display_mask = static_cast<GLuint>(-1);
- CGLRendererInfoObj renderer_info = nullptr;
- GLint num_renderers = 0;
- if (CGLQueryRendererInfo(display_mask,
- &renderer_info,
- &num_renderers) != kCGLNoError)
- return false;
-
- scoped_ptr<CGLRendererInfoObj,
- CGLRendererInfoObjDeleter> scoper(&renderer_info);
-
- for (GLint renderer_index = 0;
- renderer_index < num_renderers;
- ++renderer_index) {
- // Skip this if this renderer is not the current renderer.
- GLint renderer_id = 0;
- if (CGLDescribeRenderer(renderer_info,
- renderer_index,
- kCGLRPRendererID,
- &renderer_id) != kCGLNoError)
- continue;
- if (renderer_id != current_renderer_id)
- continue;
- // Retrieve the video memory for the renderer.
- GLint video_memory = 0;
- if (CGLDescribeRenderer(renderer_info,
- renderer_index,
- kCGLRPVideoMemory,
- &video_memory) != kCGLNoError)
- continue;
- *bytes = video_memory;
- return true;
- }
-
- return false;
-}
-
void GLContextCGL::SetSafeToForceGpuSwitch() {
safe_to_force_gpu_switch_ = true;
}
« no previous file with comments | « ui/gl/gl_context_cgl.h ('k') | ui/gl/gl_context_egl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698