Revert "Add SkRegion C API"
authorMatthew Leibowitz <mattleibow@live.com>
Sat, 29 Oct 2016 11:36:20 +0000 (13:36 +0200)
committerGitHub <noreply@github.com>
Sat, 29 Oct 2016 11:36:20 +0000 (13:36 +0200)
gm/cgm.c
gyp/core.gypi
include/c/sk_region.h [deleted file]
include/c/sk_types.h
src/c/sk_region.cpp [deleted file]
src/c/sk_types_priv.h
tests/CTest.cpp

index b658d08..5e57225 100644 (file)
--- a/gm/cgm.c
+++ b/gm/cgm.c
@@ -53,7 +53,7 @@ void sk_test_c_api(sk_canvas_t* canvas) {
     sk_imageinfo_t info = {
         W, H, sk_colortype_get_default_8888(), OPAQUE_SK_ALPHATYPE
     };
-    sk_surfaceprops_t surfaceProps = { UNKNOWN_SK_PIXELGEOMETRY, USE_DEVICE_INDEPENDENT_FONTS_GR_SURFACE_PROPS_FLAGS };
+    sk_surfaceprops_t surfaceProps = { UNKNOWN_SK_PIXELGEOMETRY };
     sk_surface_t* surf = sk_surface_new_raster(&info, &surfaceProps);
     do_draw(sk_surface_get_canvas(surf));
 
index b72b85e..c9cc8f2 100644 (file)
@@ -26,7 +26,6 @@
         '<(skia_include_path)/c/sk_path.h',
         '<(skia_include_path)/c/sk_patheffect.h',
         '<(skia_include_path)/c/sk_picture.h',
-        '<(skia_include_path)/c/sk_region.h',
         '<(skia_include_path)/c/sk_shader.h',
         '<(skia_include_path)/c/sk_stream.h',
         '<(skia_include_path)/c/sk_string.h',
@@ -50,7 +49,6 @@
         '<(skia_src_path)/c/sk_path.cpp',
         '<(skia_src_path)/c/sk_patheffect.cpp',
         '<(skia_src_path)/c/sk_picture.cpp',
-        '<(skia_src_path)/c/sk_region.cpp',
         '<(skia_src_path)/c/sk_shader.cpp',
         '<(skia_src_path)/c/sk_stream.cpp',
         '<(skia_src_path)/c/sk_string.cpp',
diff --git a/include/c/sk_region.h b/include/c/sk_region.h
deleted file mode 100755 (executable)
index 0705c38..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2016 Bluebeam Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef sk_region_DEFINED
-#define sk_region_DEFINED
-
-#include "sk_types.h"
-
-SK_C_PLUS_PLUS_BEGIN_GUARD
-
-SK_API sk_region_t* sk_region_new();
-SK_API sk_region_t* sk_region_new2(const sk_region_t* region);
-SK_API void sk_region_delete(sk_region_t* cpath); 
-SK_API void sk_region_contains(sk_region_t* r, const sk_region_t* region); 
-SK_API void sk_region_contains2(sk_region_t* r, int x, int y);
-SK_API bool sk_region_intersects(sk_region_t* r, const sk_region_t* src); 
-SK_API bool sk_region_set_path(sk_region_t* dst, const sk_path_t* t);
-SK_API bool sk_region_set_rect(sk_region_t* dst, const sk_irect_t* rect);
-SK_API bool sk_region_op(sk_region_t* dst, int left, int top, int right, int bottom, sk_region_op_t* op);
-SK_API bool sk_region_op2(sk_region_t* dst, sk_region_t* src, sk_region_op_t* op);
-SK_API sk_irect_t sk_region_get_bounds(sk_region_t* r);
-
-SK_C_PLUS_PLUS_END_GUARD
-
-#endif
index 2edf542..cff0f25 100644 (file)
@@ -183,12 +183,6 @@ typedef struct sk_shader_t sk_shader_t;
     For GPU drawing, the destination is a texture or a framebuffer.
 */
 typedef struct sk_surface_t sk_surface_t;
-/**
-    The sk_region encapsulates the geometric region used to specify
-    clipping areas for drawing.
-*/
-typedef struct sk_region_t sk_region_t;
-
 
 typedef enum {
     CLEAR_SK_XFERMODE_MODE,
diff --git a/src/c/sk_region.cpp b/src/c/sk_region.cpp
deleted file mode 100644 (file)
index 18fee51..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2016 Bluebeam Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkRegion.h"
-#include "sk_region.h"
-#include "sk_types_priv.h"
-
-
-sk_region_t *sk_region_new() { return (sk_region_t *)new SkRegion(); }
-
-sk_region_t *sk_region_new2(const sk_region_t *region) {
-  return ToRegion(new SkRegion(*AsRegion(region)));
-}
-
-void sk_region_delete(sk_region_t *cpath) { delete AsRegion(cpath); }
-
-void sk_region_contains(sk_region_t *r, const sk_region_t *region) {
-  AsRegion(r)->contains(*AsRegion(region));
-}
-
-void sk_region_contains2(sk_region_t *r, int x, int y) {
-  AsRegion(r)->contains(x, y);
-}
-
-bool sk_region_intersects(sk_region_t *r, const sk_region_t *src) {
-  return AsRegion(r)->intersects(*AsRegion(src));
-}
-
-bool sk_region_set_path(sk_region_t *dst, const sk_path_t *t) {
-  SkRegion region = *AsRegion(dst);
-  return region.setPath(AsPath(*t), region);
-}
-
-bool sk_region_set_rect(sk_region_t *dst, const sk_irect_t *rect) {
-  SkRegion region = *AsRegion(dst);
-  return region.setRect(AsIRect(*rect));
-}
-
-bool sk_region_op(sk_region_t *dst, int left, int top, int right, int bottom,
-                  sk_region_op_t* op) {
-  SkRegion region = *AsRegion(dst);
-  return region.op(left, top, right, bottom, (SkRegion::Op)op);
-}
-
-bool sk_region_op2(sk_region_t *dst, sk_region_t *src, sk_region_op_t* op) {
-  SkRegion region = *AsRegion(dst);
-  return region.op(*AsRegion(src), (SkRegion::Op)op);
-}
-
-sk_irect_t sk_region_get_bounds(sk_region_t *r) {
-  SkRegion region = *AsRegion(r);
-  return ToIRect(AsRegion(r)->getBounds());
-}
\ No newline at end of file
index cb64f0f..5b452f4 100644 (file)
@@ -26,7 +26,6 @@
 #include "SkFontStyle.h"
 #include "GrContext.h"
 #include "SkPathOps.h"
-#include "SkRegion.h"
 #include "SkTypeface.h"
 #include "gl/GrGLInterface.h"
 
@@ -93,24 +92,6 @@ static inline const SkIRect& AsIRect(const sk_irect_t& crect) {
     return reinterpret_cast<const SkIRect&>(crect);
 }
 
-/* SkRegion */
-static inline SkRegion* AsRegion(sk_region_t* creg) {
-    return reinterpret_cast<SkRegion*>(creg);
-}
-
-static inline const SkRegion* AsRegion(const sk_region_t* creg) {
-    return reinterpret_cast<const SkRegion*>(creg);
-}
-
-static inline const SkRegion& AsRegion(const sk_region_t& creg) {
-    return reinterpret_cast<const SkRegion&>(creg);
-}
-
-static inline sk_region_t* ToRegion(SkRegion* reg) {
-    return reinterpret_cast<sk_region_t*>(reg);
-}
-/* End SkRegion */
-
 static inline const SkBitmap* AsBitmap(const sk_bitmap_t* cbitmap) {
     return reinterpret_cast<const SkBitmap*>(cbitmap);
 }
index 76df80d..1f301ef 100644 (file)
@@ -59,7 +59,7 @@ static void test_c(skiatest::Reporter* reporter) {
         1, 1, ct, PREMUL_SK_ALPHATYPE
     };
     uint32_t pixel[1] = { 0 };
-    sk_surfaceprops_t surfaceProps = { UNKNOWN_SK_PIXELGEOMETRY, USE_DEVICE_INDEPENDENT_FONTS_GR_SURFACE_PROPS_FLAGS };
+    sk_surfaceprops_t surfaceProps = { UNKNOWN_SK_PIXELGEOMETRY };
 
     sk_surface_t* surface = sk_surface_new_raster_direct(&info, pixel, sizeof(uint32_t),
                                                          &surfaceProps);