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

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

Issue 2106843002: Remove unsafe cast from ImageTransportSurfaceOverlayMac::ScheduleCALayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from piman. 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
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
379 // static 383 // static
380 unsigned GLImageIOSurface::GetInternalFormatForTesting( 384 unsigned GLImageIOSurface::GetInternalFormatForTesting(
381 gfx::BufferFormat format) { 385 gfx::BufferFormat format) {
382 DCHECK(ValidFormat(format)); 386 DCHECK(ValidFormat(format));
383 return TextureFormat(format); 387 return TextureFormat(format);
384 } 388 }
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
385 } // namespace gl 397 } // namespace gl
OLDNEW
« gpu/ipc/service/image_transport_surface_overlay_mac.mm ('K') | « 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