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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp

Issue 2640163004: Replace ENABLE(ASSERT) with DCHECK_IS_ON(). (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 m_paintState->decrementSaveCount(); 120 m_paintState->decrementSaveCount();
121 } else { 121 } else {
122 m_paintStateIndex--; 122 m_paintStateIndex--;
123 m_paintState = m_paintStateStack[m_paintStateIndex].get(); 123 m_paintState = m_paintStateStack[m_paintStateIndex].get();
124 } 124 }
125 125
126 ASSERT(m_canvas); 126 ASSERT(m_canvas);
127 m_canvas->restore(); 127 m_canvas->restore();
128 } 128 }
129 129
130 #if ENABLE(ASSERT) 130 #if DCHECK_IS_ON()
131 unsigned GraphicsContext::saveCount() const { 131 unsigned GraphicsContext::saveCount() const {
132 // Each m_paintStateStack entry implies an additional save op 132 // Each m_paintStateStack entry implies an additional save op
133 // (on top of its own saveCount), except for the first frame. 133 // (on top of its own saveCount), except for the first frame.
134 unsigned count = m_paintStateIndex; 134 unsigned count = m_paintStateIndex;
135 ASSERT(m_paintStateStack.size() > m_paintStateIndex); 135 ASSERT(m_paintStateStack.size() > m_paintStateIndex);
136 for (unsigned i = 0; i <= m_paintStateIndex; ++i) 136 for (unsigned i = 0; i <= m_paintStateIndex; ++i)
137 count += m_paintStateStack[i]->saveCount(); 137 count += m_paintStateStack[i]->saveCount();
138 138
139 return count; 139 return count;
140 } 140 }
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 static const SkPMColor colors[] = { 1414 static const SkPMColor colors[] = {
1415 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red 1415 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red
1416 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray 1416 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray
1417 }; 1417 };
1418 1418
1419 return colors[index]; 1419 return colors[index];
1420 } 1420 }
1421 #endif 1421 #endif
1422 1422
1423 } // namespace blink 1423 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698