author | dxu |
Thu, 04 Apr 2013 15:39:17 -0700 | |
changeset 16734 | da1901d79073 |
parent 12813 | c10ab96dcf41 |
child 16843 | 21ec7ce3e580 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
16734
da1901d79073
8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents:
12813
diff
changeset
|
2 |
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package sun.java2d.pipe; |
|
27 |
||
28 |
import java.awt.AlphaComposite; |
|
887 | 29 |
import java.awt.Color; |
2 | 30 |
import java.awt.Composite; |
31 |
import java.awt.Paint; |
|
32 |
import java.awt.geom.AffineTransform; |
|
887 | 33 |
import sun.java2d.pipe.hw.AccelSurface; |
2 | 34 |
import sun.java2d.InvalidPipeException; |
35 |
import sun.java2d.SunGraphics2D; |
|
36 |
import sun.java2d.loops.XORComposite; |
|
37 |
import static sun.java2d.pipe.BufferedOpCodes.*; |
|
38 |
import static sun.java2d.pipe.BufferedRenderPipe.BYTES_PER_SPAN; |
|
39 |
||
16734
da1901d79073
8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents:
12813
diff
changeset
|
40 |
import java.lang.annotation.Native; |
12813
c10ab96dcf41
7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents:
11897
diff
changeset
|
41 |
|
2 | 42 |
/** |
43 |
* Base context class for managing state in a single-threaded rendering |
|
44 |
* environment. Each state-setting operation (e.g. SET_COLOR) is added to |
|
45 |
* the provided RenderQueue, which will be processed at a later time by a |
|
46 |
* single thread. Note that the RenderQueue lock must be acquired before |
|
47 |
* calling the validate() method (or any other method in this class). See |
|
48 |
* the RenderQueue class comments for a sample usage scenario. |
|
887 | 49 |
* |
50 |
* @see RenderQueue |
|
2 | 51 |
*/ |
887 | 52 |
public abstract class BufferedContext { |
2 | 53 |
|
54 |
/* |
|
55 |
* The following flags help the internals of validate() determine |
|
56 |
* the appropriate (meaning correct, or optimal) code path when |
|
57 |
* setting up the current context. The flags can be bitwise OR'd |
|
58 |
* together as needed. |
|
59 |
*/ |
|
60 |
||
61 |
/** |
|
62 |
* Indicates that no flags are needed; take all default code paths. |
|
63 |
*/ |
|
16734
da1901d79073
8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents:
12813
diff
changeset
|
64 |
@Native public static final int NO_CONTEXT_FLAGS = (0 << 0); |
2 | 65 |
/** |
66 |
* Indicates that the source surface (or color value, if it is a simple |
|
67 |
* rendering operation) is opaque (has an alpha value of 1.0). If this |
|
68 |
* flag is present, it allows us to disable blending in certain |
|
69 |
* situations in order to improve performance. |
|
70 |
*/ |
|
16734
da1901d79073
8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents:
12813
diff
changeset
|
71 |
@Native public static final int SRC_IS_OPAQUE = (1 << 0); |
2 | 72 |
/** |
73 |
* Indicates that the operation uses an alpha mask, which may determine |
|
74 |
* the code path that is used when setting up the current paint state. |
|
75 |
*/ |
|
16734
da1901d79073
8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents:
12813
diff
changeset
|
76 |
@Native public static final int USE_MASK = (1 << 1); |
2 | 77 |
|
78 |
protected RenderQueue rq; |
|
79 |
protected RenderBuffer buf; |
|
80 |
||
81 |
/** |
|
82 |
* This is a reference to the most recently validated BufferedContext. If |
|
83 |
* this value is null, it means that there is no current context. It is |
|
84 |
* provided here so that validate() only needs to do a quick reference |
|
85 |
* check to see if the BufferedContext passed to that method is the same |
|
86 |
* as the one we've cached here. |
|
87 |
*/ |
|
88 |
protected static BufferedContext currentContext; |
|
89 |
||
887 | 90 |
private AccelSurface validatedSrcData; |
91 |
private AccelSurface validatedDstData; |
|
2 | 92 |
private Region validatedClip; |
93 |
private Composite validatedComp; |
|
94 |
private Paint validatedPaint; |
|
1732
cbd1ef3625fc
6764257: D3D/OGL: color is not reset properly after save/restoreState() [RSL]
tdv
parents:
887
diff
changeset
|
95 |
// renamed from isValidatedPaintAColor as part of a work around for 6764257 |
cbd1ef3625fc
6764257: D3D/OGL: color is not reset properly after save/restoreState() [RSL]
tdv
parents:
887
diff
changeset
|
96 |
private boolean isValidatedPaintJustAColor; |
887 | 97 |
private int validatedRGB; |
2 | 98 |
private int validatedFlags; |
99 |
private boolean xformInUse; |
|
887 | 100 |
private int transX; |
101 |
private int transY; |
|
2 | 102 |
|
103 |
protected BufferedContext(RenderQueue rq) { |
|
104 |
this.rq = rq; |
|
105 |
this.buf = rq.getBuffer(); |
|
106 |
} |
|
107 |
||
108 |
/** |
|
887 | 109 |
* Fetches the BufferedContextContext associated with the dst. surface |
110 |
* and validates the context using the given parameters. Most rendering |
|
111 |
* operations will call this method first in order to set the necessary |
|
112 |
* state before issuing rendering commands. |
|
113 |
* |
|
114 |
* Note: must be called while the RenderQueue lock is held. |
|
115 |
* |
|
11897
9e80dbac0293
7112642: Incorrect checking for graphics rendering object
bagiras
parents:
5506
diff
changeset
|
116 |
* It's assumed that the type of surfaces has been checked by the Renderer |
9e80dbac0293
7112642: Incorrect checking for graphics rendering object
bagiras
parents:
5506
diff
changeset
|
117 |
* |
887 | 118 |
* @throws InvalidPipeException if either src or dest surface is not valid |
119 |
* or lost |
|
120 |
* @see RenderQueue#lock |
|
121 |
* @see RenderQueue#unlock |
|
122 |
*/ |
|
123 |
public static void validateContext(AccelSurface srcData, |
|
124 |
AccelSurface dstData, |
|
125 |
Region clip, Composite comp, |
|
126 |
AffineTransform xform, |
|
127 |
Paint paint, SunGraphics2D sg2d, |
|
128 |
int flags) |
|
129 |
{ |
|
130 |
// assert rq.lock.isHeldByCurrentThread(); |
|
131 |
BufferedContext d3dc = dstData.getContext(); |
|
132 |
d3dc.validate(srcData, dstData, |
|
133 |
clip, comp, xform, paint, sg2d, flags); |
|
134 |
} |
|
135 |
||
136 |
/** |
|
137 |
* Fetches the BufferedContextassociated with the surface |
|
138 |
* and disables all context state settings. |
|
139 |
* |
|
140 |
* Note: must be called while the RenderQueue lock is held. |
|
141 |
* |
|
11897
9e80dbac0293
7112642: Incorrect checking for graphics rendering object
bagiras
parents:
5506
diff
changeset
|
142 |
* It's assumed that the type of surfaces has been checked by the Renderer |
9e80dbac0293
7112642: Incorrect checking for graphics rendering object
bagiras
parents:
5506
diff
changeset
|
143 |
* |
887 | 144 |
* @throws InvalidPipeException if the surface is not valid |
145 |
* or lost |
|
146 |
* @see RenderQueue#lock |
|
147 |
* @see RenderQueue#unlock |
|
148 |
*/ |
|
149 |
public static void validateContext(AccelSurface surface) { |
|
150 |
// assert rt.lock.isHeldByCurrentThread(); |
|
151 |
validateContext(surface, surface, |
|
152 |
null, null, null, null, null, NO_CONTEXT_FLAGS); |
|
153 |
} |
|
154 |
||
155 |
/** |
|
2 | 156 |
* Validates the given parameters against the current state for this |
157 |
* context. If this context is not current, it will be made current |
|
158 |
* for the given source and destination surfaces, and the viewport will |
|
159 |
* be updated. Then each part of the context state (clip, composite, |
|
160 |
* etc.) is checked against the previous value. If the value has changed |
|
161 |
* since the last call to validate(), it will be updated accordingly. |
|
162 |
* |
|
163 |
* Note that the SunGraphics2D parameter is only used for the purposes |
|
164 |
* of validating a (non-null) Paint parameter. In all other cases it |
|
165 |
* is safe to pass a null SunGraphics2D and it will be ignored. |
|
887 | 166 |
* |
167 |
* Note: must be called while the RenderQueue lock is held. |
|
168 |
* |
|
11897
9e80dbac0293
7112642: Incorrect checking for graphics rendering object
bagiras
parents:
5506
diff
changeset
|
169 |
* It's assumed that the type of surfaces has been checked by the Renderer |
9e80dbac0293
7112642: Incorrect checking for graphics rendering object
bagiras
parents:
5506
diff
changeset
|
170 |
* |
887 | 171 |
* @throws InvalidPipeException if either src or dest surface is not valid |
172 |
* or lost |
|
2 | 173 |
*/ |
887 | 174 |
public void validate(AccelSurface srcData, AccelSurface dstData, |
2 | 175 |
Region clip, Composite comp, |
176 |
AffineTransform xform, |
|
177 |
Paint paint, SunGraphics2D sg2d, int flags) |
|
178 |
{ |
|
179 |
// assert rq.lock.isHeldByCurrentThread(); |
|
180 |
||
887 | 181 |
boolean updateClip = false; |
182 |
boolean updatePaint = false; |
|
183 |
||
184 |
if (!dstData.isValid() || |
|
185 |
dstData.isSurfaceLost() || srcData.isSurfaceLost()) |
|
186 |
{ |
|
187 |
invalidateContext(); |
|
188 |
throw new InvalidPipeException("bounds changed or surface lost"); |
|
189 |
} |
|
2 | 190 |
|
887 | 191 |
if (paint instanceof Color) { |
192 |
// REMIND: not 30-bit friendly |
|
193 |
int newRGB = ((Color)paint).getRGB(); |
|
1732
cbd1ef3625fc
6764257: D3D/OGL: color is not reset properly after save/restoreState() [RSL]
tdv
parents:
887
diff
changeset
|
194 |
if (isValidatedPaintJustAColor) { |
887 | 195 |
if (newRGB != validatedRGB) { |
196 |
validatedRGB = newRGB; |
|
197 |
updatePaint = true; |
|
198 |
} |
|
199 |
} else { |
|
200 |
validatedRGB = newRGB; |
|
201 |
updatePaint = true; |
|
1732
cbd1ef3625fc
6764257: D3D/OGL: color is not reset properly after save/restoreState() [RSL]
tdv
parents:
887
diff
changeset
|
202 |
isValidatedPaintJustAColor = true; |
887 | 203 |
} |
204 |
} else if (validatedPaint != paint) { |
|
205 |
updatePaint = true; |
|
206 |
// this should be set when we are switching from paint to color |
|
207 |
// in which case this condition will be true |
|
1732
cbd1ef3625fc
6764257: D3D/OGL: color is not reset properly after save/restoreState() [RSL]
tdv
parents:
887
diff
changeset
|
208 |
isValidatedPaintJustAColor = false; |
2 | 209 |
} |
210 |
||
211 |
if ((currentContext != this) || |
|
212 |
(srcData != validatedSrcData) || |
|
213 |
(dstData != validatedDstData)) |
|
214 |
{ |
|
215 |
if (dstData != validatedDstData) { |
|
216 |
// the clip is dependent on the destination surface, so we |
|
217 |
// need to update it if we have a new destination surface |
|
218 |
updateClip = true; |
|
219 |
} |
|
220 |
||
221 |
if (paint == null) { |
|
222 |
// make sure we update the color state (otherwise, it might |
|
223 |
// not be updated if this is the first time the context |
|
224 |
// is being validated) |
|
225 |
updatePaint = true; |
|
226 |
} |
|
227 |
||
228 |
// update the current source and destination surfaces |
|
229 |
setSurfaces(srcData, dstData); |
|
230 |
||
231 |
currentContext = this; |
|
232 |
validatedSrcData = srcData; |
|
233 |
validatedDstData = dstData; |
|
234 |
} |
|
235 |
||
236 |
// validate clip |
|
887 | 237 |
if ((clip != validatedClip) || updateClip) { |
2 | 238 |
if (clip != null) { |
887 | 239 |
if (updateClip || |
240 |
validatedClip == null || |
|
241 |
!(validatedClip.isRectangular() && clip.isRectangular()) || |
|
242 |
((clip.getLoX() != validatedClip.getLoX() || |
|
243 |
clip.getLoY() != validatedClip.getLoY() || |
|
244 |
clip.getHiX() != validatedClip.getHiX() || |
|
245 |
clip.getHiY() != validatedClip.getHiY()))) |
|
246 |
{ |
|
247 |
setClip(clip); |
|
248 |
} |
|
2 | 249 |
} else { |
250 |
resetClip(); |
|
251 |
} |
|
252 |
validatedClip = clip; |
|
253 |
} |
|
254 |
||
255 |
// validate composite (note that a change in the context flags |
|
256 |
// may require us to update the composite state, even if the |
|
257 |
// composite has not changed) |
|
258 |
if ((comp != validatedComp) || (flags != validatedFlags)) { |
|
259 |
if (comp != null) { |
|
260 |
setComposite(comp, flags); |
|
261 |
} else { |
|
262 |
resetComposite(); |
|
263 |
} |
|
264 |
// the paint state is dependent on the composite state, so make |
|
265 |
// sure we update the color below |
|
266 |
updatePaint = true; |
|
267 |
validatedComp = comp; |
|
268 |
validatedFlags = flags; |
|
269 |
} |
|
270 |
||
271 |
// validate transform |
|
887 | 272 |
boolean txChanged = false; |
2 | 273 |
if (xform == null) { |
274 |
if (xformInUse) { |
|
275 |
resetTransform(); |
|
276 |
xformInUse = false; |
|
887 | 277 |
txChanged = true; |
278 |
} else if (sg2d != null) { |
|
279 |
if (transX != sg2d.transX || transY != sg2d.transY) { |
|
280 |
txChanged = true; |
|
281 |
} |
|
282 |
} |
|
283 |
if (sg2d != null) { |
|
284 |
transX = sg2d.transX; |
|
285 |
transY = sg2d.transY; |
|
2 | 286 |
} |
287 |
} else { |
|
288 |
setTransform(xform); |
|
289 |
xformInUse = true; |
|
887 | 290 |
txChanged = true; |
291 |
} |
|
292 |
// non-Color paints may require paint revalidation |
|
1732
cbd1ef3625fc
6764257: D3D/OGL: color is not reset properly after save/restoreState() [RSL]
tdv
parents:
887
diff
changeset
|
293 |
if (!isValidatedPaintJustAColor && txChanged) { |
887 | 294 |
updatePaint = true; |
2 | 295 |
} |
296 |
||
297 |
// validate paint |
|
298 |
if (updatePaint) { |
|
299 |
if (paint != null) { |
|
300 |
BufferedPaints.setPaint(rq, sg2d, paint, flags); |
|
301 |
} else { |
|
302 |
BufferedPaints.resetPaint(rq); |
|
303 |
} |
|
304 |
validatedPaint = paint; |
|
305 |
} |
|
306 |
||
307 |
// mark dstData dirty |
|
887 | 308 |
// REMIND: is this really needed now? we do it in SunGraphics2D.. |
2 | 309 |
dstData.markDirty(); |
310 |
} |
|
311 |
||
312 |
/** |
|
313 |
* Invalidates the surfaces associated with this context. This is |
|
314 |
* useful when the context is no longer needed, and we want to break |
|
315 |
* the chain caused by these surface references. |
|
887 | 316 |
* |
317 |
* Note: must be called while the RenderQueue lock is held. |
|
318 |
* |
|
319 |
* @see RenderQueue#lock |
|
320 |
* @see RenderQueue#unlock |
|
2 | 321 |
*/ |
322 |
public void invalidateSurfaces() { |
|
323 |
validatedSrcData = null; |
|
324 |
validatedDstData = null; |
|
325 |
} |
|
326 |
||
887 | 327 |
private void setSurfaces(AccelSurface srcData, |
328 |
AccelSurface dstData) |
|
329 |
{ |
|
2 | 330 |
// assert rq.lock.isHeldByCurrentThread(); |
331 |
rq.ensureCapacityAndAlignment(20, 4); |
|
332 |
buf.putInt(SET_SURFACES); |
|
333 |
buf.putLong(srcData.getNativeOps()); |
|
334 |
buf.putLong(dstData.getNativeOps()); |
|
335 |
} |
|
336 |
||
337 |
private void resetClip() { |
|
338 |
// assert rq.lock.isHeldByCurrentThread(); |
|
339 |
rq.ensureCapacity(4); |
|
340 |
buf.putInt(RESET_CLIP); |
|
341 |
} |
|
342 |
||
343 |
private void setClip(Region clip) { |
|
344 |
// assert rq.lock.isHeldByCurrentThread(); |
|
345 |
if (clip.isRectangular()) { |
|
346 |
rq.ensureCapacity(20); |
|
347 |
buf.putInt(SET_RECT_CLIP); |
|
348 |
buf.putInt(clip.getLoX()).putInt(clip.getLoY()); |
|
349 |
buf.putInt(clip.getHiX()).putInt(clip.getHiY()); |
|
350 |
} else { |
|
351 |
rq.ensureCapacity(28); // so that we have room for at least a span |
|
352 |
buf.putInt(BEGIN_SHAPE_CLIP); |
|
353 |
buf.putInt(SET_SHAPE_CLIP_SPANS); |
|
354 |
// include a placeholder for the span count |
|
355 |
int countIndex = buf.position(); |
|
356 |
buf.putInt(0); |
|
357 |
int spanCount = 0; |
|
358 |
int remainingSpans = buf.remaining() / BYTES_PER_SPAN; |
|
359 |
int span[] = new int[4]; |
|
360 |
SpanIterator si = clip.getSpanIterator(); |
|
361 |
while (si.nextSpan(span)) { |
|
362 |
if (remainingSpans == 0) { |
|
363 |
buf.putInt(countIndex, spanCount); |
|
364 |
rq.flushNow(); |
|
365 |
buf.putInt(SET_SHAPE_CLIP_SPANS); |
|
366 |
countIndex = buf.position(); |
|
367 |
buf.putInt(0); |
|
368 |
spanCount = 0; |
|
369 |
remainingSpans = buf.remaining() / BYTES_PER_SPAN; |
|
370 |
} |
|
371 |
buf.putInt(span[0]); // x1 |
|
372 |
buf.putInt(span[1]); // y1 |
|
373 |
buf.putInt(span[2]); // x2 |
|
374 |
buf.putInt(span[3]); // y2 |
|
375 |
spanCount++; |
|
376 |
remainingSpans--; |
|
377 |
} |
|
378 |
buf.putInt(countIndex, spanCount); |
|
379 |
rq.ensureCapacity(4); |
|
380 |
buf.putInt(END_SHAPE_CLIP); |
|
381 |
} |
|
382 |
} |
|
383 |
||
384 |
private void resetComposite() { |
|
385 |
// assert rq.lock.isHeldByCurrentThread(); |
|
386 |
rq.ensureCapacity(4); |
|
387 |
buf.putInt(RESET_COMPOSITE); |
|
388 |
} |
|
389 |
||
390 |
private void setComposite(Composite comp, int flags) { |
|
391 |
// assert rq.lock.isHeldByCurrentThread(); |
|
392 |
if (comp instanceof AlphaComposite) { |
|
393 |
AlphaComposite ac = (AlphaComposite)comp; |
|
394 |
rq.ensureCapacity(16); |
|
395 |
buf.putInt(SET_ALPHA_COMPOSITE); |
|
396 |
buf.putInt(ac.getRule()); |
|
397 |
buf.putFloat(ac.getAlpha()); |
|
398 |
buf.putInt(flags); |
|
399 |
} else if (comp instanceof XORComposite) { |
|
400 |
int xorPixel = ((XORComposite)comp).getXorPixel(); |
|
401 |
rq.ensureCapacity(8); |
|
402 |
buf.putInt(SET_XOR_COMPOSITE); |
|
403 |
buf.putInt(xorPixel); |
|
404 |
} else { |
|
405 |
throw new InternalError("not yet implemented"); |
|
406 |
} |
|
407 |
} |
|
408 |
||
409 |
private void resetTransform() { |
|
410 |
// assert rq.lock.isHeldByCurrentThread(); |
|
411 |
rq.ensureCapacity(4); |
|
412 |
buf.putInt(RESET_TRANSFORM); |
|
413 |
} |
|
414 |
||
415 |
private void setTransform(AffineTransform xform) { |
|
416 |
// assert rq.lock.isHeldByCurrentThread(); |
|
417 |
rq.ensureCapacityAndAlignment(52, 4); |
|
418 |
buf.putInt(SET_TRANSFORM); |
|
419 |
buf.putDouble(xform.getScaleX()); |
|
420 |
buf.putDouble(xform.getShearY()); |
|
421 |
buf.putDouble(xform.getShearX()); |
|
422 |
buf.putDouble(xform.getScaleY()); |
|
423 |
buf.putDouble(xform.getTranslateX()); |
|
424 |
buf.putDouble(xform.getTranslateY()); |
|
425 |
} |
|
887 | 426 |
|
427 |
/** |
|
428 |
* Resets this context's surfaces and all attributes. |
|
429 |
* |
|
430 |
* Note: must be called while the RenderQueue lock is held. |
|
431 |
* |
|
432 |
* @see RenderQueue#lock |
|
433 |
* @see RenderQueue#unlock |
|
434 |
*/ |
|
435 |
public void invalidateContext() { |
|
436 |
resetTransform(); |
|
437 |
resetComposite(); |
|
438 |
resetClip(); |
|
1732
cbd1ef3625fc
6764257: D3D/OGL: color is not reset properly after save/restoreState() [RSL]
tdv
parents:
887
diff
changeset
|
439 |
BufferedPaints.resetPaint(rq); |
887 | 440 |
invalidateSurfaces(); |
441 |
validatedComp = null; |
|
442 |
validatedClip = null; |
|
443 |
validatedPaint = null; |
|
1732
cbd1ef3625fc
6764257: D3D/OGL: color is not reset properly after save/restoreState() [RSL]
tdv
parents:
887
diff
changeset
|
444 |
isValidatedPaintJustAColor = false; |
887 | 445 |
xformInUse = false; |
446 |
} |
|
447 |
||
448 |
/** |
|
449 |
* Returns a singleton {@code RenderQueue} object used by the rendering |
|
450 |
* pipeline. |
|
451 |
* |
|
452 |
* @return a render queue |
|
453 |
* @see RenderQueue |
|
454 |
*/ |
|
455 |
public abstract RenderQueue getRenderQueue(); |
|
456 |
||
457 |
/** |
|
458 |
* Saves the the state of this context. |
|
459 |
* It may reset the current context. |
|
460 |
* |
|
461 |
* Note: must be called while the RenderQueue lock is held. |
|
462 |
* |
|
463 |
* @see RenderQueue#lock |
|
464 |
* @see RenderQueue#unlock |
|
465 |
*/ |
|
466 |
public abstract void saveState(); |
|
467 |
||
468 |
/** |
|
469 |
* Restores the native state of this context. |
|
470 |
* It may reset the current context. |
|
471 |
* |
|
472 |
* Note: must be called while the RenderQueue lock is held. |
|
473 |
* |
|
474 |
* @see RenderQueue#lock |
|
475 |
* @see RenderQueue#unlock |
|
476 |
*/ |
|
477 |
public abstract void restoreState(); |
|
2 | 478 |
} |