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

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

Issue 2104393003: Revert of Remove unsafe cast from ImageTransportSurfaceOverlayMac::ScheduleCALayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « ui/gl/gl_image_io_surface.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <map> 7 #include <map>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/mac/bind_objc_block.h" 10 #include "base/mac/bind_objc_block.h"
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 } 369 }
370 370
371 base::ScopedCFTypeRef<IOSurfaceRef> GLImageIOSurface::io_surface() { 371 base::ScopedCFTypeRef<IOSurfaceRef> GLImageIOSurface::io_surface() {
372 return io_surface_; 372 return io_surface_;
373 } 373 }
374 374
375 base::ScopedCFTypeRef<CVPixelBufferRef> GLImageIOSurface::cv_pixel_buffer() { 375 base::ScopedCFTypeRef<CVPixelBufferRef> GLImageIOSurface::cv_pixel_buffer() {
376 return cv_pixel_buffer_; 376 return cv_pixel_buffer_;
377 } 377 }
378 378
379 GLImage::Type GLImageIOSurface::GetType() const {
380 return Type::IOSURFACE;
381 }
382
383 // static 379 // static
384 unsigned GLImageIOSurface::GetInternalFormatForTesting( 380 unsigned GLImageIOSurface::GetInternalFormatForTesting(
385 gfx::BufferFormat format) { 381 gfx::BufferFormat format) {
386 DCHECK(ValidFormat(format)); 382 DCHECK(ValidFormat(format));
387 return TextureFormat(format); 383 return TextureFormat(format);
388 } 384 }
389
390 // static
391 GLImageIOSurface* GLImageIOSurface::FromGLImage(GLImage* image) {
392 if (!image || image->GetType() != Type::IOSURFACE)
393 return nullptr;
394 return static_cast<GLImageIOSurface*>(image);
395 }
396
397 } // namespace gl 385 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_image_io_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698