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

Side by Side Diff: include/gpu/GrRect.h

Issue 19449002: Replace all instances of GrRect with SkRect. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « include/gpu/GrOvalRenderer.h ('k') | include/gpu/GrRenderTarget.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
2 /* 1 /*
3 * Copyright 2010 Google Inc. 2 * Copyright 2010 Google Inc.
4 * 3 *
5 * 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
6 * found in the LICENSE file. 5 * found in the LICENSE file.
7 */ 6 */
8 7
9
10
11 #ifndef GrRect_DEFINED 8 #ifndef GrRect_DEFINED
12 #define GrRect_DEFINED 9 #define GrRect_DEFINED
13 10
14 #include "GrPoint.h" 11 #include "SkTypes.h"
15 #include "SkRect.h" 12 #include "SkRect.h"
16 13
17 typedef SkIRect GrIRect;
18 typedef SkRect GrRect;
19
20 struct GrIRect16 { 14 struct GrIRect16 {
21 int16_t fLeft, fTop, fRight, fBottom; 15 int16_t fLeft, fTop, fRight, fBottom;
22 16
23 int width() const { return fRight - fLeft; } 17 int width() const { return fRight - fLeft; }
24 int height() const { return fBottom - fTop; } 18 int height() const { return fBottom - fTop; }
25 int area() const { return this->width() * this->height(); } 19 int area() const { return this->width() * this->height(); }
26 bool isEmpty() const { return fLeft >= fRight || fTop >= fBottom; } 20 bool isEmpty() const { return fLeft >= fRight || fTop >= fBottom; }
27 21
28 void set(const GrIRect& r) { 22 void set(const SkIRect& r) {
29 fLeft = SkToS16(r.fLeft); 23 fLeft = SkToS16(r.fLeft);
30 fTop = SkToS16(r.fTop); 24 fTop = SkToS16(r.fTop);
31 fRight = SkToS16(r.fRight); 25 fRight = SkToS16(r.fRight);
32 fBottom = SkToS16(r.fBottom); 26 fBottom = SkToS16(r.fBottom);
33 } 27 }
34 }; 28 };
35 29
36 #endif 30 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrOvalRenderer.h ('k') | include/gpu/GrRenderTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698