OLD | NEW |
---|---|
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 Loading... | |
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 // Note that gfx::AcceleratedWidget does not actually map to CALayer in this |
198 // context. It may be that the types should coincide. | |
199 CALayer* layer = base::mac::ObjCCastStrict<CALayer>(widget); | |
200 | |
201 // Also note that transactions are not disabled. The caller must ensure that | |
202 // all changes to the CALayer tree happen atomically. | |
203 [layer setContents:(id)io_surface_.get()]; | |
Andre
2015/07/22 21:34:36
Style guide prohibits C style casts.
ccameron
2015/07/23 05:33:02
Changed to static_cast<id>.
| |
204 [layer setFrame:bounds_rect.ToCGRect()]; | |
205 return true; | |
196 } | 206 } |
197 | 207 |
198 } // namespace gfx | 208 } // namespace gfx |
OLD | NEW |