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);
53 bool isDefault()
const;
55 uint envMode, combineRGB, combineAlpha;
56 byte constA, constR, constG, constB;
64 DrawCall_Rasterization,
69 DrawCall(DrawCallType type) : _type(type) { }
71 bool operator==(
const DrawCall &other)
const;
72 bool operator!=(
const DrawCall &other)
const {
73 return !(*
this == other);
75 virtual void execute(
bool restoreState,
const Common::Rect *clippingRectangle =
nullptr)
const = 0;
76 DrawCallType getType()
const {
return _type; }
77 virtual const Common::Rect getDirtyRegion()
const {
return _dirtyRegion; }
86 ClearBufferDrawCall(
bool clearZBuffer,
int zValue,
bool clearColorBuffer,
int rValue,
int gValue,
int bValue,
bool clearStencilBuffer,
int stencilValue);
89 virtual void execute(
bool restoreState,
const Common::Rect *clippingRectangle =
nullptr)
const;
91 void *
operator new(
size_t size) {
92 return Internal::allocateFrame(size);
95 void operator delete(
void *p) { }
97 bool _clearZBuffer, _clearColorBuffer, _clearStencilBuffer;
98 int _rValue, _gValue, _bValue, _zValue, _stencilValue;
99 struct ClearBufferState {
103 bool operator==(
const ClearBufferState &other)
const {
105 enableScissor == other.enableScissor &&
106 scissor[0] == other.scissor[0] &&
107 scissor[1] == other.scissor[1] &&
108 scissor[2] == other.scissor[2] &&
109 scissor[3] == other.scissor[3];
113 ClearBufferState captureState()
const;
114 void applyState(
const ClearBufferState &state,
const Common::Rect *clippingRectangle)
const;
116 ClearBufferState _clearState;
125 virtual void execute(
bool restoreState,
const Common::Rect *clippingRectangle =
nullptr)
const;
127 void *
operator new(
size_t size) {
128 return Internal::allocateFrame(size);
131 void operator delete(
void *p) { }
133 void computeDirtyRegion();
137 gl_draw_triangle_func_ptr _drawTriangleFront, _drawTriangleBack;
139 struct RasterizationState {
143 int currentFrontFace;
149 bool depthTestEnabled;
152 bool texture2DEnabled;
153 int currentShadeModel;
155 int polygonModeFront;
164 float viewportTranslation[3];
165 float viewportScaling[3];
166 bool alphaTestEnabled;
169 bool stencilTestEnabled;
173 byte stencilWriteMask;
177 bool polygonStippleEnabled;
178 byte polygonStipplePattern[128];
180 bool two_color_stipple_enabled;
189 bool operator==(
const RasterizationState &other)
const;
192 RasterizationState _state;
194 RasterizationState captureState()
const;
195 void applyState(
const RasterizationState &state,
const Common::Rect *clippingRectangle)
const;
210 virtual void execute(
bool restoreState,
const Common::Rect *clippingRectangle =
nullptr)
const;
212 BlittingMode getBlittingMode()
const {
return _mode; }
214 void *
operator new(
size_t size) {
215 return Internal::allocateFrame(size);
218 void operator delete(
void *p) { }
220 void computeDirtyRegion();
226 struct BlittingState {
230 int sfactor, dfactor;
232 int alphaFunc, alphaRefValue;
233 int depthTestEnabled;
235 bool operator==(
const BlittingState &other)
const {
237 enableScissor == other.enableScissor &&
238 scissor[0] == other.scissor[0] &&
239 scissor[1] == other.scissor[1] &&
240 scissor[2] == other.scissor[2] &&
241 scissor[3] == other.scissor[3] &&
242 enableBlending == other.enableBlending &&
243 sfactor == other.sfactor &&
244 dfactor == other.dfactor &&
245 alphaTest == other.alphaTest &&
246 alphaFunc == other.alphaFunc &&
247 alphaRefValue == other.alphaRefValue &&
248 depthTestEnabled == other.depthTestEnabled;
252 BlittingState captureState()
const;
253 void applyState(
const BlittingState &state,
const Common::Rect *clippingRectangle)
const;
255 BlittingState _blitState;
Definition: zdirtyrect.h:199
Definition: zdirtyrect.h:60
Definition: zdirtyrect.h:120
Definition: colormasks.h:27
Definition: zdirtyrect.h:84
Definition: zdirtyrect.h:41
Definition: ios7_video.h:39
Definition: zdirtyrect.h:51