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

Side by Side Diff: ui/gl/gl_image_io_surface.mm

Issue 1251783002: Mac Overlays: Wire up overlays on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@part22
Patch Set: Add more dchecks Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gl/gl_image_io_surface.h" 5 #include "ui/gl/gl_image_io_surface.h"
6 6
7 #include "base/mac/foundation_util.h"
7 #include "ui/gl/gl_bindings.h" 8 #include "ui/gl/gl_bindings.h"
8 #include "ui/gl/gl_context.h" 9 #include "ui/gl/gl_context.h"
9 10
10 // Note that this must be included after gl_bindings.h to avoid conflicts. 11 // Note that this must be included after gl_bindings.h to avoid conflicts.
12 #include <Quartz/Quartz.h>
11 #include <OpenGL/CGLIOSurface.h> 13 #include <OpenGL/CGLIOSurface.h>
12 14
13 namespace gfx { 15 namespace gfx {
14 namespace { 16 namespace {
15 17
16 bool ValidInternalFormat(unsigned internalformat) { 18 bool ValidInternalFormat(unsigned internalformat) {
17 switch (internalformat) { 19 switch (internalformat) {
18 case GL_R8: 20 case GL_R8:
19 case GL_BGRA_EXT: 21 case GL_BGRA_EXT:
20 return true; 22 return true;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 const Point& offset, 187 const Point& offset,
186 const Rect& rect) { 188 const Rect& rect) {
187 return false; 189 return false;
188 } 190 }
189 191
190 bool GLImageIOSurface::ScheduleOverlayPlane(gfx::AcceleratedWidget widget, 192 bool GLImageIOSurface::ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
191 int z_order, 193 int z_order,
192 OverlayTransform transform, 194 OverlayTransform transform,
193 const Rect& bounds_rect, 195 const Rect& bounds_rect,
194 const RectF& crop_rect) { 196 const RectF& crop_rect) {
195 return false; 197 // Only simple overlay planes are currently supported.
198 DCHECK_EQ(z_order, 0);
199 DCHECK_EQ(crop_rect.ToString(), gfx::RectF(0, 0, 1, 1).ToString());
200 DCHECK_EQ(transform, gfx::OVERLAY_TRANSFORM_NONE);
201
202 // Note that gfx::AcceleratedWidget does not actually map to CALayer in this
203 // context. It may be that the types should coincide.
204 CALayer* layer = base::mac::ObjCCastStrict<CALayer>(widget);
alexst (slow to review) 2015/07/22 14:38:02 In the type definitions #elif defined(OS_MACOSX)
ccameron 2015/07/23 05:33:02 I'm not sure if we actually use NSView as a type a
205
206 // Also note that transactions are not disabled. The caller must ensure that
207 // all changes to the CALayer tree happen atomically.
208 [layer setContents:(id)io_surface_.get()];
209 [layer setFrame:bounds_rect.ToCGRect()];
210 return true;
196 } 211 }
197 212
198 } // namespace gfx 213 } // namespace gfx
OLDNEW
« content/common/gpu/image_transport_surface_overlay_mac.mm ('K') | « ui/gl/gl_image_io_surface.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698