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

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

Issue 13852049: Add GPU support for roundrects (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Remove some unnecessary checks Created 7 years, 8 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 10
11 #ifndef GrRect_DEFINED 11 #ifndef GrRect_DEFINED
12 #define GrRect_DEFINED 12 #define GrRect_DEFINED
13 13
14 #include "GrPoint.h" 14 #include "GrPoint.h"
15 #include "SkRect.h" 15 #include "SkRect.h"
16 #include "SkRRect.h"
16 17
17 typedef SkIRect GrIRect; 18 typedef SkIRect GrIRect;
18 typedef SkRect GrRect; 19 typedef SkRect GrRect;
robertphillips 2013/04/24 15:13:30 Do we really need to add a GrRRect?
jvanverth1 2013/04/24 19:02:27 Done.
20 typedef SkRRect GrRRect;
19 21
20 struct GrIRect16 { 22 struct GrIRect16 {
21 int16_t fLeft, fTop, fRight, fBottom; 23 int16_t fLeft, fTop, fRight, fBottom;
22 24
23 int width() const { return fRight - fLeft; } 25 int width() const { return fRight - fLeft; }
24 int height() const { return fBottom - fTop; } 26 int height() const { return fBottom - fTop; }
25 int area() const { return this->width() * this->height(); } 27 int area() const { return this->width() * this->height(); }
26 bool isEmpty() const { return fLeft >= fRight || fTop >= fBottom; } 28 bool isEmpty() const { return fLeft >= fRight || fTop >= fBottom; }
27 29
28 void set(const GrIRect& r) { 30 void set(const GrIRect& r) {
29 fLeft = SkToS16(r.fLeft); 31 fLeft = SkToS16(r.fLeft);
30 fTop = SkToS16(r.fTop); 32 fTop = SkToS16(r.fTop);
31 fRight = SkToS16(r.fRight); 33 fRight = SkToS16(r.fRight);
32 fBottom = SkToS16(r.fBottom); 34 fBottom = SkToS16(r.fBottom);
33 } 35 }
34 }; 36 };
35 37
36 #endif 38 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698