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

Unified Diff: ui/gl/gl_image_io_surface.mm

Issue 1280033004: Revert of Mac Overlays: Add GPU back-pressure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « ui/gl/gl_image_io_surface.h ('k') | ui/gl/scoped_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_io_surface.mm
diff --git a/ui/gl/gl_image_io_surface.mm b/ui/gl/gl_image_io_surface.mm
index b488c533cc49c2a3295e48836499f125dc3d2830..2044f3775a16590370ee323eac853eb007aaf98f 100644
--- a/ui/gl/gl_image_io_surface.mm
+++ b/ui/gl/gl_image_io_surface.mm
@@ -199,12 +199,22 @@
OverlayTransform transform,
const Rect& bounds_rect,
const RectF& crop_rect) {
- NOTREACHED();
- return false;
-}
-
-base::ScopedCFTypeRef<IOSurfaceRef> GLImageIOSurface::io_surface() {
- return io_surface_;
+ // Only simple overlay planes are currently supported.
+ DCHECK_EQ(0, z_order);
+ DCHECK_EQ(gfx::RectF(0, 0, 1, 1).ToString(), crop_rect.ToString());
+ DCHECK_EQ(gfx::OVERLAY_TRANSFORM_NONE, transform);
+
+ // Convert the phony widget to the appropriate CALayer.
+ auto found = g_widget_to_layer_map.Pointer()->find(widget);
+ if (found == g_widget_to_layer_map.Pointer()->end())
+ return false;
+ CALayer* layer = found->second;
+
+ // Also note that transactions are not disabled. The caller must ensure that
+ // all changes to the CALayer tree happen atomically.
+ [layer setContents:static_cast<id>(io_surface_.get())];
+ [layer setFrame:bounds_rect.ToCGRect()];
+ return true;
}
// static
« no previous file with comments | « ui/gl/gl_image_io_surface.h ('k') | ui/gl/scoped_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698