app_server/Interface Kit: add new clipping API
* Add new clipping API for rectangles (ClipToRect, ClipToInverseRect) and shapes (ClipToShape, ClipToInverseShape) * Works with affine transforms and automatically switches from fast region-based clipping to alpha-mask based clipping as necessary. * Always self-intersecting, i.e. no state push required to further narrow down the clipping region. All of the 4 new methods can be mixed in any order.
This commit is contained in:
@@ -96,6 +96,11 @@ public:
|
||||
const int32& token);
|
||||
|
||||
status_t WriteBlendLayer(Layer* layer);
|
||||
status_t WriteClipToRect(const BRect& rect,
|
||||
bool inverse);
|
||||
status_t WriteClipToShape(int32 opCount,
|
||||
const void* opList, int32 ptCount,
|
||||
const void* ptList, bool inverse);
|
||||
|
||||
protected:
|
||||
// throw a status_t on error
|
||||
|
||||
@@ -85,6 +85,9 @@ struct picture_player_callbacks {
|
||||
alpha_function alphaFunctionMode);
|
||||
void (*set_transform)(void* userData, const BAffineTransform& transform);
|
||||
void (*blend_layer)(void* userData, Layer* layer);
|
||||
void (*clip_to_rect)(void* userData, const BRect& rect, bool inverse);
|
||||
void (*clip_to_shape)(void* userData, int32 opCount, const uint32 opList[],
|
||||
int32 ptCount, const BPoint ptList[], bool inverse);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ enum {
|
||||
B_PIC_PUSH_STATE = 0x0203,
|
||||
B_PIC_POP_STATE = 0x0204,
|
||||
B_PIC_CLEAR_CLIPPING_RECTS = 0x0205,
|
||||
B_PIC_CLIP_TO_RECT = 0x0206,
|
||||
B_PIC_CLIP_TO_SHAPE = 0x0207,
|
||||
|
||||
B_PIC_SET_ORIGIN = 0x0300,
|
||||
B_PIC_SET_PEN_LOCATION = 0x0301,
|
||||
|
||||
Reference in New Issue
Block a user