| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 231 } |
| 232 | 232 |
| 233 gfx::Size GLImageIOSurface::GetSize() { | 233 gfx::Size GLImageIOSurface::GetSize() { |
| 234 return size_; | 234 return size_; |
| 235 } | 235 } |
| 236 | 236 |
| 237 unsigned GLImageIOSurface::GetInternalFormat() { | 237 unsigned GLImageIOSurface::GetInternalFormat() { |
| 238 return internalformat_; | 238 return internalformat_; |
| 239 } | 239 } |
| 240 | 240 |
| 241 bool GLImageIOSurface::BindTexImage(unsigned target) { | 241 bool GLImageIOSurface::BindTexImage(unsigned target, GLFence* fence) { |
| 242 DCHECK(thread_checker_.CalledOnValidThread()); | 242 DCHECK(thread_checker_.CalledOnValidThread()); |
| 243 TRACE_EVENT0("gpu", "GLImageIOSurface::BindTexImage"); | 243 TRACE_EVENT0("gpu", "GLImageIOSurface::BindTexImage"); |
| 244 base::TimeTicks start_time = base::TimeTicks::Now(); | 244 base::TimeTicks start_time = base::TimeTicks::Now(); |
| 245 | 245 |
| 246 // YUV_420_BIPLANAR is not supported by BindTexImage. | 246 // YUV_420_BIPLANAR is not supported by BindTexImage. |
| 247 // CopyTexImage is supported by this format as that performs conversion to RGB | 247 // CopyTexImage is supported by this format as that performs conversion to RGB |
| 248 // as part of the copy operation. | 248 // as part of the copy operation. |
| 249 if (format_ == gfx::BufferFormat::YUV_420_BIPLANAR) | 249 if (format_ == gfx::BufferFormat::YUV_420_BIPLANAR) |
| 250 return false; | 250 return false; |
| 251 | 251 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 } | 405 } |
| 406 | 406 |
| 407 // static | 407 // static |
| 408 GLImageIOSurface* GLImageIOSurface::FromGLImage(GLImage* image) { | 408 GLImageIOSurface* GLImageIOSurface::FromGLImage(GLImage* image) { |
| 409 if (!image || image->GetType() != Type::IOSURFACE) | 409 if (!image || image->GetType() != Type::IOSURFACE) |
| 410 return nullptr; | 410 return nullptr; |
| 411 return static_cast<GLImageIOSurface*>(image); | 411 return static_cast<GLImageIOSurface*>(image); |
| 412 } | 412 } |
| 413 | 413 |
| 414 } // namespace gl | 414 } // namespace gl |
| OLD | NEW |