X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2Fskia%2Finclude%2Fgpu%2FGrRect.h;h=14130f831c3f5fb185335cc8476e42627253f6c2;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=ddb23b5a19c8388c0771ac10a5c6967ea2b1be17;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/skia/include/gpu/GrRect.h b/src/third_party/skia/include/gpu/GrRect.h index ddb23b5..14130f8 100644 --- a/src/third_party/skia/include/gpu/GrRect.h +++ b/src/third_party/skia/include/gpu/GrRect.h @@ -20,6 +20,18 @@ struct GrIRect16 { 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(); } @@ -27,6 +39,13 @@ struct GrIRect16 { 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);