| 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 <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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 } | 224 } |
| 225 | 225 |
| 226 gfx::Size GLImageIOSurface::GetSize() { | 226 gfx::Size GLImageIOSurface::GetSize() { |
| 227 return size_; | 227 return size_; |
| 228 } | 228 } |
| 229 | 229 |
| 230 unsigned GLImageIOSurface::GetInternalFormat() { | 230 unsigned GLImageIOSurface::GetInternalFormat() { |
| 231 return internalformat_; | 231 return internalformat_; |
| 232 } | 232 } |
| 233 | 233 |
| 234 bool GLImageIOSurface::BindTexImage(unsigned target) { | 234 bool GLImageIOSurface::BindTexImage(unsigned target, GLFence* fence) { |
| 235 DCHECK(thread_checker_.CalledOnValidThread()); | 235 DCHECK(thread_checker_.CalledOnValidThread()); |
| 236 TRACE_EVENT0("gpu", "GLImageIOSurface::BindTexImage"); | 236 TRACE_EVENT0("gpu", "GLImageIOSurface::BindTexImage"); |
| 237 base::TimeTicks start_time = base::TimeTicks::Now(); | 237 base::TimeTicks start_time = base::TimeTicks::Now(); |
| 238 | 238 |
| 239 // YUV_420_BIPLANAR is not supported by BindTexImage. | 239 // YUV_420_BIPLANAR is not supported by BindTexImage. |
| 240 // CopyTexImage is supported by this format as that performs conversion to RGB | 240 // CopyTexImage is supported by this format as that performs conversion to RGB |
| 241 // as part of the copy operation. | 241 // as part of the copy operation. |
| 242 if (format_ == gfx::BufferFormat::YUV_420_BIPLANAR) | 242 if (format_ == gfx::BufferFormat::YUV_420_BIPLANAR) |
| 243 return false; | 243 return false; |
| 244 | 244 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 } | 398 } |
| 399 | 399 |
| 400 // static | 400 // static |
| 401 GLImageIOSurface* GLImageIOSurface::FromGLImage(GLImage* image) { | 401 GLImageIOSurface* GLImageIOSurface::FromGLImage(GLImage* image) { |
| 402 if (!image || image->GetType() != Type::IOSURFACE) | 402 if (!image || image->GetType() != Type::IOSURFACE) |
| 403 return nullptr; | 403 return nullptr; |
| 404 return static_cast<GLImageIOSurface*>(image); | 404 return static_cast<GLImageIOSurface*>(image); |
| 405 } | 405 } |
| 406 | 406 |
| 407 } // namespace gl | 407 } // namespace gl |
| OLD | NEW |