app_server: finish BShape-based alpha mask generation
This commit is contained in:
parent
ab12093685
commit
23af4ff6ac
@ -19,6 +19,7 @@
|
||||
#include "ServerBitmap.h"
|
||||
#include "ServerPicture.h"
|
||||
#include "Shape.h"
|
||||
#include "ShapePrivate.h"
|
||||
|
||||
|
||||
// #pragma mark - AlphaMask
|
||||
@ -249,6 +250,8 @@ VectorAlphaMask<VectorMaskType>::_RenderSource()
|
||||
drawState->SetDrawingModeLocked(true);
|
||||
canvas.PushState();
|
||||
|
||||
canvas.ResyncDrawState();
|
||||
|
||||
if (engine->LockParallelAccess()) {
|
||||
BRegion clipping;
|
||||
clipping.Set((clipping_rect)fBounds);
|
||||
@ -330,12 +333,14 @@ PictureAlphaMask::GetDrawState() const
|
||||
// #pragma mark - ShapeAlphaMask
|
||||
|
||||
|
||||
ShapeAlphaMask::ShapeAlphaMask(AlphaMask* previousMask, BPoint where,
|
||||
bool inverse)
|
||||
ShapeAlphaMask::ShapeAlphaMask(AlphaMask* previousMask,
|
||||
const shape_data& shape, BPoint where, bool inverse)
|
||||
:
|
||||
VectorAlphaMask<ShapeAlphaMask>(previousMask, where, inverse),
|
||||
fShape(shape),
|
||||
fDrawState()
|
||||
{
|
||||
fBounds = fShape.DetermineBoundingBox();
|
||||
_Generate();
|
||||
}
|
||||
|
||||
@ -343,15 +348,17 @@ ShapeAlphaMask::ShapeAlphaMask(AlphaMask* previousMask, BPoint where,
|
||||
void
|
||||
ShapeAlphaMask::DrawVectors(Canvas* canvas)
|
||||
{
|
||||
// TODO
|
||||
canvas->GetDrawingEngine()->DrawShape(fBounds,
|
||||
fShape.opCount, fShape.opList,
|
||||
fShape.ptCount, fShape.ptList,
|
||||
true, BPoint(0, 0), 1.0);
|
||||
}
|
||||
|
||||
|
||||
BRect
|
||||
ShapeAlphaMask::DetermineBoundingBox() const
|
||||
{
|
||||
// TODO
|
||||
return BRect(0, 0, 0, 0);
|
||||
return fBounds;
|
||||
}
|
||||
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
class BShape;
|
||||
class ServerBitmap;
|
||||
class ServerPicture;
|
||||
class shape_data;
|
||||
|
||||
|
||||
// #pragma mark - AlphaMask
|
||||
@ -121,6 +122,7 @@ private:
|
||||
class ShapeAlphaMask : public VectorAlphaMask<ShapeAlphaMask> {
|
||||
public:
|
||||
ShapeAlphaMask(AlphaMask* previousMask,
|
||||
const shape_data& shape,
|
||||
BPoint where, bool inverse);
|
||||
|
||||
void DrawVectors(Canvas* canvas);
|
||||
@ -128,6 +130,8 @@ public:
|
||||
const DrawState& GetDrawState() const;
|
||||
|
||||
private:
|
||||
const shape_data& fShape;
|
||||
BRect fBounds;
|
||||
DrawState fDrawState;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user