OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_memory.h" | 5 #include "ui/gl/gl_image_memory.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
9 #include "ui/gl/gl_bindings.h" | 9 #include "ui/gl/gl_bindings.h" |
10 #include "ui/gl/scoped_binders.h" | 10 #include "ui/gl/scoped_binders.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 egl_texture_id_ = 0u; | 231 egl_texture_id_ = 0u; |
232 } | 232 } |
233 #endif | 233 #endif |
234 memory_ = NULL; | 234 memory_ = NULL; |
235 } | 235 } |
236 | 236 |
237 Size GLImageMemory::GetSize() { | 237 Size GLImageMemory::GetSize() { |
238 return size_; | 238 return size_; |
239 } | 239 } |
240 | 240 |
| 241 unsigned GLImageMemory::GetInternalFormat() { |
| 242 return internalformat_; |
| 243 } |
| 244 |
241 bool GLImageMemory::BindTexImage(unsigned target) { | 245 bool GLImageMemory::BindTexImage(unsigned target) { |
242 if (target_ && target_ != target) { | 246 if (target_ && target_ != target) { |
243 LOG(ERROR) << "GLImage can only be bound to one target"; | 247 LOG(ERROR) << "GLImage can only be bound to one target"; |
244 return false; | 248 return false; |
245 } | 249 } |
246 target_ = target; | 250 target_ = target; |
247 | 251 |
248 // Defer DoBindTexImage if not currently in use. | 252 // Defer DoBindTexImage if not currently in use. |
249 if (!in_use_) { | 253 if (!in_use_) { |
250 need_do_bind_tex_image_ = true; | 254 need_do_bind_tex_image_ = true; |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 size_.width(), | 406 size_.width(), |
403 size_.height(), | 407 size_.height(), |
404 0, // border | 408 0, // border |
405 DataFormat(format_), | 409 DataFormat(format_), |
406 DataType(format_), | 410 DataType(format_), |
407 memory_); | 411 memory_); |
408 } | 412 } |
409 } | 413 } |
410 | 414 |
411 } // namespace gfx | 415 } // namespace gfx |
OLD | NEW |