22 #ifndef GRAPHICS_TINYGL_ZRECT_H 23 #define GRAPHICS_TINYGL_ZRECT_H 25 #include "common/types.h" 26 #include "common/rect.h" 27 #include "common/array.h" 29 #include "graphics/tinygl/zblit.h" 34 void *allocateFrame(
int size);
45 DrawCall_Rasterization,
50 DrawCall(DrawCallType type) : _type(type) { }
52 bool operator==(
const DrawCall &other)
const;
53 bool operator!=(
const DrawCall &other)
const {
54 return !(*
this == other);
56 virtual void execute(
bool restoreState,
const Common::Rect *clippingRectangle =
nullptr)
const = 0;
57 DrawCallType getType()
const {
return _type; }
58 virtual const Common::Rect getDirtyRegion()
const {
return _dirtyRegion; }
67 ClearBufferDrawCall(
bool clearZBuffer,
int zValue,
bool clearColorBuffer,
int rValue,
int gValue,
int bValue,
bool clearStencilBuffer,
int stencilValue);
70 virtual void execute(
bool restoreState,
const Common::Rect *clippingRectangle =
nullptr)
const;
72 void *
operator new(
size_t size) {
73 return Internal::allocateFrame(size);
76 void operator delete(
void *p) { }
78 bool _clearZBuffer, _clearColorBuffer, _clearStencilBuffer;
79 int _rValue, _gValue, _bValue, _zValue, _stencilValue;
80 struct ClearBufferState {
84 bool operator==(
const ClearBufferState &other)
const {
86 enableScissor == other.enableScissor &&
87 scissor[0] == other.scissor[0] &&
88 scissor[1] == other.scissor[1] &&
89 scissor[2] == other.scissor[2] &&
90 scissor[3] == other.scissor[3];
94 ClearBufferState captureState()
const;
95 void applyState(
const ClearBufferState &state,
const Common::Rect *clippingRectangle)
const;
97 ClearBufferState _clearState;
106 virtual void execute(
bool restoreState,
const Common::Rect *clippingRectangle =
nullptr)
const;
108 void *
operator new(
size_t size) {
109 return Internal::allocateFrame(size);
112 void operator delete(
void *p) { }
114 void computeDirtyRegion();
118 gl_draw_triangle_func_ptr _drawTriangleFront, _drawTriangleBack;
120 struct RasterizationState {
124 int currentFrontFace;
130 bool depthTestEnabled;
133 bool texture2DEnabled;
134 int currentShadeModel;
136 int polygonModeFront;
145 float viewportTranslation[3];
146 float viewportScaling[3];
147 bool alphaTestEnabled;
150 bool stencilTestEnabled;
154 uint stencilWriteMask;
158 bool polygonStippleEnabled;
159 byte polygonStipplePattern[128];
167 bool operator==(
const RasterizationState &other)
const;
170 RasterizationState _state;
172 RasterizationState captureState()
const;
173 void applyState(
const RasterizationState &state,
const Common::Rect *clippingRectangle)
const;
188 virtual void execute(
bool restoreState,
const Common::Rect *clippingRectangle =
nullptr)
const;
190 BlittingMode getBlittingMode()
const {
return _mode; }
192 void *
operator new(
size_t size) {
193 return Internal::allocateFrame(size);
196 void operator delete(
void *p) { }
198 void computeDirtyRegion();
204 struct BlittingState {
208 int sfactor, dfactor;
210 int alphaFunc, alphaRefValue;
211 int depthTestEnabled;
213 bool operator==(
const BlittingState &other)
const {
215 enableScissor == other.enableScissor &&
216 scissor[0] == other.scissor[0] &&
217 scissor[1] == other.scissor[1] &&
218 scissor[2] == other.scissor[2] &&
219 scissor[3] == other.scissor[3] &&
220 enableBlending == other.enableBlending &&
221 sfactor == other.sfactor &&
222 dfactor == other.dfactor &&
223 alphaTest == other.alphaTest &&
224 alphaFunc == other.alphaFunc &&
225 alphaRefValue == other.alphaRefValue &&
226 depthTestEnabled == other.depthTestEnabled;
230 BlittingState captureState()
const;
231 void applyState(
const BlittingState &state,
const Common::Rect *clippingRectangle)
const;
233 BlittingState _blitState;
Definition: zdirtyrect.h:177
Definition: zdirtyrect.h:41
Definition: zdirtyrect.h:101
Definition: colormasks.h:27
Definition: zdirtyrect.h:65
Definition: ios7_video.h:39