From d537341e16524d1e22ac5e6c8b9c8f274ba1833c Mon Sep 17 00:00:00 2001 From: robertphillips Date: Mon, 2 Jun 2014 10:20:14 -0700 Subject: Move GrIPoint16 to SkIPoint16 (and remove GrPoint.h) R=bsalomon@google.com, reed@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/309683002 --- include/core/SkPoint.h | 22 ++++++++++++++++++++++ include/gpu/GrContext.h | 1 - include/gpu/GrGlyph.h | 2 +- include/gpu/GrPoint.h | 36 ------------------------------------ 4 files changed, 23 insertions(+), 38 deletions(-) delete mode 100644 include/gpu/GrPoint.h (limited to 'include') diff --git a/include/core/SkPoint.h b/include/core/SkPoint.h index 5dd331a14c..6f32d98c75 100644 --- a/include/core/SkPoint.h +++ b/include/core/SkPoint.h @@ -11,6 +11,28 @@ #include "SkMath.h" #include "SkScalar.h" +/** \struct SkIPoint16 + + SkIPoint holds two 16 bit integer coordinates +*/ +struct SkIPoint16 { + int16_t fX, fY; + + static SkIPoint16 Make(int x, int y) { + SkIPoint16 pt; + pt.set(x, y); + return pt; + } + + int16_t x() const { return fX; } + int16_t y() const { return fY; } + + void set(int x, int y) { + fX = SkToS16(x); + fY = SkToS16(y); + } +}; + /** \struct SkIPoint SkIPoint holds two 32 bit integer coordinates diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h index c54f2e6b23..41ee15917f 100644 --- a/include/gpu/GrContext.h +++ b/include/gpu/GrContext.h @@ -12,7 +12,6 @@ #include "GrColor.h" #include "GrPaint.h" #include "GrPathRendererChain.h" -#include "GrPoint.h" #include "GrRenderTarget.h" #include "GrTexture.h" #include "SkMatrix.h" diff --git a/include/gpu/GrGlyph.h b/include/gpu/GrGlyph.h index 6de0c57d98..a7d834153f 100644 --- a/include/gpu/GrGlyph.h +++ b/include/gpu/GrGlyph.h @@ -26,7 +26,7 @@ struct GrGlyph { SkPath* fPath; PackedID fPackedID; GrIRect16 fBounds; - GrIPoint16 fAtlasLocation; + SkIPoint16 fAtlasLocation; void init(GrGlyph::PackedID packed, const SkIRect& bounds) { fPlot = NULL; diff --git a/include/gpu/GrPoint.h b/include/gpu/GrPoint.h deleted file mode 100644 index 16738f5243..0000000000 --- a/include/gpu/GrPoint.h +++ /dev/null @@ -1,36 +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 GrPoint_DEFINED -#define GrPoint_DEFINED - -#include "GrTypes.h" -#include "SkScalar.h" -#include "SkPoint.h" - -struct GrIPoint16 { - int16_t fX, fY; - - static GrIPoint16 Make(intptr_t x, intptr_t y) { - GrIPoint16 pt; - pt.set(x, y); - return pt; - } - - int16_t x() const { return fX; } - int16_t y() const { return fY; } - - void set(intptr_t x, intptr_t y) { - fX = SkToS16(x); - fY = SkToS16(y); - } -}; - -#endif -- cgit v1.2.3