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

Unified Diff: content/browser/renderer_host/compositing_iosurface_mac.mm

Issue 12383042: Switch all contexts in a share group to be on the same screen as the window they present to. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/compositing_iosurface_mac.mm
diff --git a/content/browser/renderer_host/compositing_iosurface_mac.mm b/content/browser/renderer_host/compositing_iosurface_mac.mm
index a300eeed9f73db0964f1c7332db41199fd5153a1..37ac4c9eb5b5da78e0791ae8fbe66a62df5ba1bf 100644
--- a/content/browser/renderer_host/compositing_iosurface_mac.mm
+++ b/content/browser/renderer_host/compositing_iosurface_mac.mm
@@ -4,6 +4,7 @@
#include "content/browser/renderer_host/compositing_iosurface_mac.h"
+#include <OpenGL/CGLRenderers.h>
#include <OpenGL/OpenGL.h>
#include <vector>
@@ -318,6 +319,15 @@ void CompositingIOSurfaceMac::SetIOSurface(uint64 io_surface_handle,
CGLSetCurrentContext(0);
}
+int CompositingIOSurfaceMac::GetRenderer() {
+ GLint current_renderer_id = -1;
+ if (CGLGetParameter(cglContext_,
+ kCGLCPCurrentRendererID,
+ &current_renderer_id) == kCGLNoError)
+ return current_renderer_id & kCGLRendererIDMatchingMask;
+ return -1;
+}
+
void CompositingIOSurfaceMac::DrawIOSurface(NSView* view, float scale_factor) {
CGLSetCurrentContext(cglContext_);

Powered by Google App Engine
This is Rietveld 408576698