Author: tkreuzer
Date: Wed Feb 11 21:36:01 2015
New Revision: 66232
URL: http://svn.reactos.org/svn/reactos?rev=66232&view=rev
Log:
[MESA]
Partly sync find_value() with MESA 10.4.4. Fixes endless loop when GoogleEarth is started. GoogleEarth now loads and displays the earth, but it doesn't handle any input and makes the entire GUI hang.
Modified:
trunk/reactos/dll/opengl/mesa/main/get.c
Modified: trunk/reactos/dll/opengl/mesa/main/get.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/main/get.c…
==============================================================================
--- trunk/reactos/dll/opengl/mesa/main/get.c [iso-8859-1] (original)
+++ trunk/reactos/dll/opengl/mesa/main/get.c [iso-8859-1] Wed Feb 11 21:36:01 2015
@@ -1132,10 +1132,20 @@
mask = Elements(table) - 1;
hash = (pname * prime_factor);
while (1) {
- d = &values[table[hash & mask]];
-
+ int idx = table[hash & mask];
+
+ /* If the enum isn't valid, the hash walk ends with index 0,
+ * pointing to the first entry of values[] which doesn't hold
+ * any valid enum. */
+ if (unlikely(idx == 0)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
+ _mesa_lookup_enum_by_nr(pname));
+ return &error_value;
+ }
+
+ d = &values[idx];
if (likely(d->pname == pname))
- break;
+ break;
hash += prime_step;
}
Author: tkreuzer
Date: Wed Feb 11 21:34:42 2015
New Revision: 66229
URL: http://svn.reactos.org/svn/reactos?rev=66229&view=rev
Log:
[WIN32K]
- Handle the case where we have a masked ROP, but no mask surface in EngBitBlt
- Alloc ROPs with a mask in EngPaint
Fixes ASSERT when GoogleEarth is launched.
Modified:
trunk/reactos/win32ss/gdi/eng/bitblt.c
trunk/reactos/win32ss/gdi/eng/bitblt_new.c
trunk/reactos/win32ss/gdi/eng/paint.c
Modified: trunk/reactos/win32ss/gdi/eng/bitblt.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/bitblt.c?r…
==============================================================================
--- trunk/reactos/win32ss/gdi/eng/bitblt.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/eng/bitblt.c [iso-8859-1] Wed Feb 11 21:34:42 2015
@@ -458,6 +458,19 @@
else
{
clippingType = pco->iDComplexity;
+ }
+
+ /* Check if we need a mask but have no mask surface */
+ if (UsesMask && (psoMask == NULL))
+ {
+ /* Check if the BRUSHOBJ can provide the mask */
+ psoMask = BRUSHOBJ_psoMask(pbo);
+ if (psoMask == NULL)
+ {
+ /* We have no mask, assume the mask is all foreground */
+ rop4 &= (rop4 & 0xFF) || ((rop4 & 0xFF) << 8);
+ UsesMask = FALSE;
+ }
}
if (UsesMask)
Modified: trunk/reactos/win32ss/gdi/eng/bitblt_new.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/bitblt_new…
==============================================================================
--- trunk/reactos/win32ss/gdi/eng/bitblt_new.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/eng/bitblt_new.c [iso-8859-1] Wed Feb 11 21:34:42 2015
@@ -210,7 +210,7 @@
if (ROP4_USES_PATTERN(rop4))
{
/* Must have a brush */
- ASSERT(pbo); // FIXME: test this!
+ NT_ASSERT(pbo); // FIXME: test this!
/* Copy the solid color */
bltdata.ulSolidColor = pbo->iSolidColor;
@@ -253,11 +253,22 @@
/* Check if the ROP uses a mask */
if (ROP4_USES_MASK(rop4))
{
- /* Must have a mask surface and point */
- ASSERT(psoMask);
- ASSERT(pptlMask);
-
//__debugbreak();
+
+ /* Check if we don't have a mask surface */
+ if (psoMask == NULL)
+ {
+ /* Must have a brush */
+ NT_ASSERT(pbo); // FIXME: test this!
+
+ /* Check if the BRUSHOBJ can provide the mask */
+ psoMask = BRUSHOBJ_psoMask(pbo);
+ if (psoMask == NULL)
+ {
+ /* We have no mask, assume the mask is all foreground */
+ rop4 = (rop4 & 0xFF) || ((rop4 & 0xFF) << 8);
+ }
+ }
/* Set the mask format info */
bltdata.siMsk.iFormat = psoMask->iBitmapFormat;
Modified: trunk/reactos/win32ss/gdi/eng/paint.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/paint.c?re…
==============================================================================
--- trunk/reactos/win32ss/gdi/eng/paint.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/eng/paint.c [iso-8859-1] Wed Feb 11 21:34:42 2015
@@ -63,9 +63,8 @@
/* Convert the MIX, consisting of 2 ROP2 codes into a ROP4 */
rop4 = MIX_TO_ROP4(mix);
- /* Sanity checks */
+ /* Sanity check */
NT_ASSERT(!ROP4_USES_SOURCE(rop4));
- NT_ASSERT(!ROP4_USES_MASK(rop4));
/* Forward the call to Eng/DrvBitBlt */
return IntEngBitBlt(pso,