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

Side by Side Diff: ui/gl/gl_image_memory.cc

Issue 1140683002: glBindTexImage2DCHROMIUM should retain pixel format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add GetInternalFormat override to MockGLImage. Created 5 years, 7 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
« no previous file with comments | « ui/gl/gl_image_memory.h ('k') | ui/gl/gl_image_stub.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/gl/gl_image_memory.h ('k') | ui/gl/gl_image_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698