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));
'<(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',
'<(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',
+++ /dev/null
-/*
- * 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
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,
+++ /dev/null
-/*
- * 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
#include "SkFontStyle.h"
#include "GrContext.h"
#include "SkPathOps.h"
-#include "SkRegion.h"
#include "SkTypeface.h"
#include "gl/GrGLInterface.h"
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);
}
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);