| 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 #ifndef UI_GL_GL_IMAGE_IO_SURFACE_H_ | 5 #ifndef UI_GL_GL_IMAGE_IO_SURFACE_H_ |
| 6 #define UI_GL_GL_IMAGE_IO_SURFACE_H_ | 6 #define UI_GL_GL_IMAGE_IO_SURFACE_H_ |
| 7 | 7 |
| 8 #include <CoreVideo/CVPixelBuffer.h> | 8 #include <CoreVideo/CVPixelBuffer.h> |
| 9 #include <IOSurface/IOSurface.h> | 9 #include <IOSurface/IOSurface.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 const gfx::RectF& crop_rect) override; | 58 const gfx::RectF& crop_rect) override; |
| 59 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, | 59 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, |
| 60 uint64_t process_tracing_id, | 60 uint64_t process_tracing_id, |
| 61 const std::string& dump_name) override; | 61 const std::string& dump_name) override; |
| 62 bool EmulatingRGB() const override; | 62 bool EmulatingRGB() const override; |
| 63 | 63 |
| 64 gfx::GenericSharedMemoryId io_surface_id() const { return io_surface_id_; } | 64 gfx::GenericSharedMemoryId io_surface_id() const { return io_surface_id_; } |
| 65 base::ScopedCFTypeRef<IOSurfaceRef> io_surface(); | 65 base::ScopedCFTypeRef<IOSurfaceRef> io_surface(); |
| 66 base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer(); | 66 base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer(); |
| 67 | 67 |
| 68 // Whether checking IOSurfaceIsInUse() will actually provide a meaningful |
| 69 // signal about whether the Window Server is still using the IOSurface. |
| 70 bool CanCheckIOSurfaceIsInUse() const; |
| 71 |
| 68 static unsigned GetInternalFormatForTesting(gfx::BufferFormat format); | 72 static unsigned GetInternalFormatForTesting(gfx::BufferFormat format); |
| 69 | 73 |
| 70 protected: | 74 protected: |
| 71 ~GLImageIOSurface() override; | 75 ~GLImageIOSurface() override; |
| 72 | 76 |
| 73 private: | 77 private: |
| 74 class RGBConverter; | 78 class RGBConverter; |
| 75 | 79 |
| 76 const gfx::Size size_; | 80 const gfx::Size size_; |
| 77 | 81 |
| 78 // The "internalformat" exposed to the command buffer, which may not be | 82 // The "internalformat" exposed to the command buffer, which may not be |
| 79 // "internalformat" requested by the client. | 83 // "internalformat" requested by the client. |
| 80 const unsigned internalformat_; | 84 const unsigned internalformat_; |
| 81 | 85 |
| 82 // The "internalformat" requested by the client. | 86 // The "internalformat" requested by the client. |
| 83 const unsigned client_internalformat_; | 87 const unsigned client_internalformat_; |
| 84 | 88 |
| 85 gfx::BufferFormat format_; | 89 gfx::BufferFormat format_; |
| 86 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; | 90 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; |
| 87 base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer_; | 91 base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer_; |
| 88 gfx::GenericSharedMemoryId io_surface_id_; | 92 gfx::GenericSharedMemoryId io_surface_id_; |
| 89 base::ThreadChecker thread_checker_; | 93 base::ThreadChecker thread_checker_; |
| 90 | 94 |
| 91 DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface); | 95 DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface); |
| 92 }; | 96 }; |
| 93 | 97 |
| 94 } // namespace gl | 98 } // namespace gl |
| 95 | 99 |
| 96 #endif // UI_GL_GL_IMAGE_IO_SURFACE_H_ | 100 #endif // UI_GL_GL_IMAGE_IO_SURFACE_H_ |
| OLD | NEW |