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

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

Issue 1213193003: Remove DCHECK_IMPLIES and CHECK_IMPLIES (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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_fence_egl.cc ('k') | ui/views/touchui/touch_selection_menu_runner_views.cc » ('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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 return false; 219 return false;
220 } 220 }
221 221
222 if (!ValidFormat(format)) { 222 if (!ValidFormat(format)) {
223 LOG(ERROR) << "Invalid format: " << format; 223 LOG(ERROR) << "Invalid format: " << format;
224 return false; 224 return false;
225 } 225 }
226 226
227 DCHECK(memory); 227 DCHECK(memory);
228 DCHECK(!memory_); 228 DCHECK(!memory_);
229 DCHECK_IMPLIES(IsCompressedFormat(format), size_.width() % 4 == 0); 229 DCHECK(!IsCompressedFormat(format) || size_.width() % 4 == 0);
230 DCHECK_IMPLIES(IsCompressedFormat(format), size_.height() % 4 == 0); 230 DCHECK(!IsCompressedFormat(format) || size_.height() % 4 == 0);
231 memory_ = memory; 231 memory_ = memory;
232 format_ = format; 232 format_ = format;
233 return true; 233 return true;
234 } 234 }
235 235
236 void GLImageMemory::Destroy(bool have_context) { 236 void GLImageMemory::Destroy(bool have_context) {
237 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \ 237 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \
238 defined(USE_OZONE) 238 defined(USE_OZONE)
239 if (egl_image_ != EGL_NO_IMAGE_KHR) { 239 if (egl_image_ != EGL_NO_IMAGE_KHR) {
240 eglDestroyImageKHR(GLSurfaceEGL::GetHardwareDisplay(), egl_image_); 240 eglDestroyImageKHR(GLSurfaceEGL::GetHardwareDisplay(), egl_image_);
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 size_.width(), 433 size_.width(),
434 size_.height(), 434 size_.height(),
435 0, // border 435 0, // border
436 DataFormat(format_), 436 DataFormat(format_),
437 DataType(format_), 437 DataType(format_),
438 memory_); 438 memory_);
439 } 439 }
440 } 440 }
441 441
442 } // namespace gfx 442 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_fence_egl.cc ('k') | ui/views/touchui/touch_selection_menu_runner_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698