diff options
author | reed <reed@google.com> | 2015-12-26 18:20:00 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-26 18:20:00 -0800 |
commit | 98e7538be3e891efeff8ad8f51f3b53cc70db541 (patch) | |
tree | da2978b8681d0c1dd7eca1d2fafb275ac73c92c8 /include | |
parent | 48eb08a790b32a4d39d8bb91983434e25d8b0b4e (diff) |
make GrRect.h private
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1548213002
TBR=bsalomon
Review URL: https://codereview.chromium.org/1548213002
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrRect.h | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/include/gpu/GrRect.h b/include/gpu/GrRect.h deleted file mode 100644 index 14130f831c..0000000000 --- a/include/gpu/GrRect.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2010 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef GrRect_DEFINED -#define GrRect_DEFINED - -#include "SkTypes.h" -#include "SkRect.h" - -struct GrIRect16 { - int16_t fLeft, fTop, fRight, fBottom; - - static GrIRect16 SK_WARN_UNUSED_RESULT MakeEmpty() { - GrIRect16 r; - r.setEmpty(); - return r; - } - - static GrIRect16 SK_WARN_UNUSED_RESULT MakeWH(int16_t w, int16_t h) { - GrIRect16 r; - r.set(0, 0, w, h); - return r; - } - - static GrIRect16 SK_WARN_UNUSED_RESULT MakeXYWH(int16_t x, int16_t y, int16_t w, int16_t h) { - GrIRect16 r; - r.set(x, y, x + w, y + h); - return r; - } - - int width() const { return fRight - fLeft; } - int height() const { return fBottom - fTop; } - int area() const { return this->width() * this->height(); } - bool isEmpty() const { return fLeft >= fRight || fTop >= fBottom; } - - void setEmpty() { memset(this, 0, sizeof(*this)); } - - void set(int16_t left, int16_t top, int16_t right, int16_t bottom) { - fLeft = left; - fTop = top; - fRight = right; - fBottom = bottom; - } - - void set(const SkIRect& r) { - fLeft = SkToS16(r.fLeft); - fTop = SkToS16(r.fTop); - fRight = SkToS16(r.fRight); - fBottom = SkToS16(r.fBottom); - } -}; - -#endif |