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

Unified Diff: content/browser/compositor/io_surface_layer_mac.mm

Issue 625753002: IOSurface CGL context current lifetime cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/compositor/io_surface_texture_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/io_surface_layer_mac.mm
diff --git a/content/browser/compositor/io_surface_layer_mac.mm b/content/browser/compositor/io_surface_layer_mac.mm
index 7b07adf2733b9e13885e458295c4bcdf05cd988e..d09f24c490265f8efda06d5898b603cc261706d1 100644
--- a/content/browser/compositor/io_surface_layer_mac.mm
+++ b/content/browser/compositor/io_surface_layer_mac.mm
@@ -168,14 +168,6 @@ void IOSurfaceLayerHelper::EndPumpingFrames() {
@implementation IOSurfaceLayer
-- (content::IOSurfaceTexture*)iosurface {
- return iosurface_.get();
-}
-
-- (content::IOSurfaceContext*)context {
- return context_.get();
-}
-
- (id)initWithClient:(content::IOSurfaceLayerClient*)client
withScaleFactor:(float)scale_factor {
if (self = [super init]) {
@@ -211,7 +203,7 @@ void IOSurfaceLayerHelper::EndPumpingFrames() {
- (bool)gotFrameWithIOSurface:(IOSurfaceID)io_surface_id
withPixelSize:(gfx::Size)pixel_size
withScaleFactor:(float)scale_factor {
- return iosurface_->SetIOSurface(context_, io_surface_id, pixel_size);
+ return iosurface_->SetIOSurface(io_surface_id, pixel_size);
}
- (void)poisonContextAndSharegroup {
@@ -229,7 +221,13 @@ void IOSurfaceLayerHelper::EndPumpingFrames() {
}
- (int)rendererID {
- return iosurface_->GetRendererID();
+ GLint current_renderer_id = -1;
+ if (CGLGetParameter(context_->cgl_context(),
+ kCGLCPCurrentRendererID,
+ &current_renderer_id) == kCGLNoError) {
+ return current_renderer_id & kCGLRendererIDMatchingMask;
+ }
+ return -1;
}
- (void)resetClient {
@@ -291,12 +289,6 @@ void IOSurfaceLayerHelper::EndPumpingFrames() {
displayTime:(const CVTimeStamp*)timeStamp {
TRACE_EVENT0("browser", "IOSurfaceLayer::drawInCGLContext");
- if (!iosurface_->HasIOSurface() || context_->cgl_context() != glContext) {
- glClearColor(1, 1, 1, 1);
- glClear(GL_COLOR_BUFFER_BIT);
- return;
- }
-
bool draw_succeeded = iosurface_->DrawIOSurface();
if (helper_)
helper_->DidDraw(draw_succeeded);
« no previous file with comments | « no previous file | content/browser/compositor/io_surface_texture_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698