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

Side by Side Diff: src/gpu/gl/GrGLIRect.h

Issue 22850006: Replace uses of GrAssert by SkASSERT. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/gl/GrGLEffectMatrix.cpp ('k') | src/gpu/gl/GrGLIndexBuffer.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 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 9
10 #ifndef GrGLIRect_DEFINED 10 #ifndef GrGLIRect_DEFINED
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 GrSurfaceOrigin origin) { 47 GrSurfaceOrigin origin) {
48 fLeft = glRect.fLeft + leftOffset; 48 fLeft = glRect.fLeft + leftOffset;
49 fWidth = width; 49 fWidth = width;
50 if (kBottomLeft_GrSurfaceOrigin == origin) { 50 if (kBottomLeft_GrSurfaceOrigin == origin) {
51 fBottom = glRect.fBottom + (glRect.fHeight - topOffset - height); 51 fBottom = glRect.fBottom + (glRect.fHeight - topOffset - height);
52 } else { 52 } else {
53 fBottom = glRect.fBottom + topOffset; 53 fBottom = glRect.fBottom + topOffset;
54 } 54 }
55 fHeight = height; 55 fHeight = height;
56 56
57 GrAssert(fLeft >= 0); 57 SkASSERT(fLeft >= 0);
58 GrAssert(fWidth >= 0); 58 SkASSERT(fWidth >= 0);
59 GrAssert(fBottom >= 0); 59 SkASSERT(fBottom >= 0);
60 GrAssert(fHeight >= 0); 60 SkASSERT(fHeight >= 0);
61 } 61 }
62 62
63 bool contains(const GrGLIRect& glRect) const { 63 bool contains(const GrGLIRect& glRect) const {
64 return fLeft <= glRect.fLeft && 64 return fLeft <= glRect.fLeft &&
65 fBottom <= glRect.fBottom && 65 fBottom <= glRect.fBottom &&
66 fLeft + fWidth >= glRect.fLeft + glRect.fWidth && 66 fLeft + fWidth >= glRect.fLeft + glRect.fWidth &&
67 fBottom + fHeight >= glRect.fBottom + glRect.fHeight; 67 fBottom + fHeight >= glRect.fBottom + glRect.fHeight;
68 } 68 }
69 69
70 void invalidate() {fLeft = fWidth = fBottom = fHeight = -1;} 70 void invalidate() {fLeft = fWidth = fBottom = fHeight = -1;}
71 71
72 bool operator ==(const GrGLIRect& glRect) const { 72 bool operator ==(const GrGLIRect& glRect) const {
73 return 0 == memcmp(this, &glRect, sizeof(GrGLIRect)); 73 return 0 == memcmp(this, &glRect, sizeof(GrGLIRect));
74 } 74 }
75 75
76 bool operator !=(const GrGLIRect& glRect) const {return !(*this == glRect);} 76 bool operator !=(const GrGLIRect& glRect) const {return !(*this == glRect);}
77 }; 77 };
78 78
79 #endif 79 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLEffectMatrix.cpp ('k') | src/gpu/gl/GrGLIndexBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698