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

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

Issue 623563003: Refactor and delete IOSurface code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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/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 16fab0e30460f062679d7682b35899c8087993aa..7b07adf2733b9e13885e458295c4bcdf05cd988e 100644
--- a/content/browser/compositor/io_surface_layer_mac.mm
+++ b/content/browser/compositor/io_surface_layer_mac.mm
@@ -211,12 +211,7 @@ void IOSurfaceLayerHelper::EndPumpingFrames() {
- (bool)gotFrameWithIOSurface:(IOSurfaceID)io_surface_id
withPixelSize:(gfx::Size)pixel_size
withScaleFactor:(float)scale_factor {
- bool result = true;
- gfx::ScopedCGLSetCurrentContext scoped_set_current_context(
- context_->cgl_context());
- result = iosurface_->SetIOSurfaceWithContextCurrent(
- context_, io_surface_id, pixel_size, scale_factor);
- return result;
+ return iosurface_->SetIOSurface(context_, io_surface_id, pixel_size);
}
- (void)poisonContextAndSharegroup {
@@ -228,7 +223,9 @@ void IOSurfaceLayerHelper::EndPumpingFrames() {
}
- (float)scaleFactor {
- return iosurface_->scale_factor();
+ if ([self respondsToSelector:(@selector(contentsScale))])
+ return [self contentsScale];
+ return 1;
}
- (int)rendererID {
@@ -300,21 +297,7 @@ void IOSurfaceLayerHelper::EndPumpingFrames() {
return;
}
- // The correct viewport to cover the layer will be set up by the caller.
- // Transform this into a window size for DrawIOSurface, where it will be
- // transformed back into this viewport.
- GLint viewport[4];
- glGetIntegerv(GL_VIEWPORT, viewport);
- gfx::Rect window_rect(viewport[0], viewport[1], viewport[2], viewport[3]);
- float window_scale_factor = 1.f;
- if ([self respondsToSelector:(@selector(contentsScale))])
- window_scale_factor = [self contentsScale];
- window_rect = ToNearestRect(
- gfx::ScaleRect(window_rect, 1.f/window_scale_factor));
-
- bool draw_succeeded = iosurface_->DrawIOSurface(
- context_, window_rect, window_scale_factor);
-
+ bool draw_succeeded = iosurface_->DrawIOSurface();
if (helper_)
helper_->DidDraw(draw_succeeded);
« no previous file with comments | « content/browser/compositor/io_surface_context_mac.h ('k') | content/browser/compositor/io_surface_texture_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698