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

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

Issue 2160093002: Allow GrReducedClip to take non-integer query bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix tests on ubuntu Created 4 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 | « src/gpu/GrReducedClip.cpp ('k') | src/utils/SkLua.cpp » ('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 SkASSERT(fLeft >= 0);
58 SkASSERT(fWidth >= 0); 57 SkASSERT(fWidth >= 0);
59 SkASSERT(fBottom >= 0);
60 SkASSERT(fHeight >= 0); 58 SkASSERT(fHeight >= 0);
61 } 59 }
62 60
63 bool contains(const GrGLIRect& glRect) const { 61 bool contains(const GrGLIRect& glRect) const {
64 return fLeft <= glRect.fLeft && 62 return fLeft <= glRect.fLeft &&
65 fBottom <= glRect.fBottom && 63 fBottom <= glRect.fBottom &&
66 fLeft + fWidth >= glRect.fLeft + glRect.fWidth && 64 fLeft + fWidth >= glRect.fLeft + glRect.fWidth &&
67 fBottom + fHeight >= glRect.fBottom + glRect.fHeight; 65 fBottom + fHeight >= glRect.fBottom + glRect.fHeight;
68 } 66 }
69 67
70 void invalidate() {fLeft = fWidth = fBottom = fHeight = -1;} 68 void invalidate() {fLeft = fWidth = fBottom = fHeight = -1;}
71 69
72 bool operator ==(const GrGLIRect& glRect) const { 70 bool operator ==(const GrGLIRect& glRect) const {
73 return 0 == memcmp(this, &glRect, sizeof(GrGLIRect)); 71 return 0 == memcmp(this, &glRect, sizeof(GrGLIRect));
74 } 72 }
75 73
76 bool operator !=(const GrGLIRect& glRect) const {return !(*this == glRect);} 74 bool operator !=(const GrGLIRect& glRect) const {return !(*this == glRect);}
77 }; 75 };
78 76
79 #endif 77 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrReducedClip.cpp ('k') | src/utils/SkLua.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698