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

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

Issue 1417903005: Revert of Remove DCHECK_IMPLIES/CHECK_IMPLIES. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/gfx/buffer_format_util.h" 9 #include "ui/gfx/buffer_format_util.h"
10 #include "ui/gl/gl_bindings.h" 10 #include "ui/gl/gl_bindings.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 return false; 251 return false;
252 } 252 }
253 253
254 if (!ValidFormat(format)) { 254 if (!ValidFormat(format)) {
255 LOG(ERROR) << "Invalid format: " << static_cast<int>(format); 255 LOG(ERROR) << "Invalid format: " << static_cast<int>(format);
256 return false; 256 return false;
257 } 257 }
258 258
259 DCHECK(memory); 259 DCHECK(memory);
260 DCHECK(!memory_); 260 DCHECK(!memory_);
261 DCHECK(!IsCompressedFormat(format) || size_.width() % 4 == 0); 261 DCHECK_IMPLIES(IsCompressedFormat(format), size_.width() % 4 == 0);
262 DCHECK(!IsCompressedFormat(format) || size_.height() % 4 == 0); 262 DCHECK_IMPLIES(IsCompressedFormat(format), size_.height() % 4 == 0);
263 memory_ = memory; 263 memory_ = memory;
264 format_ = format; 264 format_ = format;
265 return true; 265 return true;
266 } 266 }
267 267
268 void GLImageMemory::Destroy(bool have_context) { 268 void GLImageMemory::Destroy(bool have_context) {
269 memory_ = nullptr; 269 memory_ = nullptr;
270 } 270 }
271 271
272 Size GLImageMemory::GetSize() { 272 Size GLImageMemory::GetSize() {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 return false; 362 return false;
363 } 363 }
364 364
365 // static 365 // static
366 unsigned GLImageMemory::GetInternalFormatForTesting(BufferFormat format) { 366 unsigned GLImageMemory::GetInternalFormatForTesting(BufferFormat format) {
367 DCHECK(ValidFormat(format)); 367 DCHECK(ValidFormat(format));
368 return TextureFormat(format); 368 return TextureFormat(format);
369 } 369 }
370 370
371 } // namespace gfx 371 } // 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