Merge pull request #3694 from akallabeth/avc420_black_artifact_fix

Fixed solid fill command.
This commit is contained in:
Martin Fleisz 2017-01-13 09:24:52 +01:00 committed by GitHub
commit 99c9195218
2 changed files with 42 additions and 17 deletions

View File

@ -530,6 +530,12 @@ BOOL planar_decompress(BITMAP_PLANAR_CONTEXT* planar,
} }
else /* NoAlpha */ else /* NoAlpha */
{ {
const UINT32 color = GetColor(TempFormat, 0, 0, 0, 0xFF);
if (!freerdp_image_fill(pTempData, TempFormat, nTempStep, nXDst, nYDst, nSrcWidth, nSrcHeight,
color))
return FALSE;
status = planar_decompress_plane_rle(planes[0], rleSizes[0], status = planar_decompress_plane_rle(planes[0], rleSizes[0],
pTempData, nTempStep, nXDst, nYDst, nSrcWidth, nSrcHeight, 2, pTempData, nTempStep, nXDst, nYDst, nSrcWidth, nSrcHeight, 2,
vFlip); /* RedPlane */ vFlip); /* RedPlane */

View File

@ -491,6 +491,7 @@ static UINT gdi_SurfaceCommand_Alpha(rdpGdi* gdi, RdpgfxClientContext* context,
const RDPGFX_SURFACE_COMMAND* cmd) const RDPGFX_SURFACE_COMMAND* cmd)
{ {
UINT status = CHANNEL_RC_OK; UINT status = CHANNEL_RC_OK;
UINT32 color;
gdiGfxSurface* surface; gdiGfxSurface* surface;
RECTANGLE_16 invalidRect; RECTANGLE_16 invalidRect;
surface = (gdiGfxSurface*) context->GetSurfaceData(context, cmd->surfaceId); surface = (gdiGfxSurface*) context->GetSurfaceData(context, cmd->surfaceId);
@ -499,10 +500,11 @@ static UINT gdi_SurfaceCommand_Alpha(rdpGdi* gdi, RdpgfxClientContext* context,
return ERROR_INTERNAL_ERROR; return ERROR_INTERNAL_ERROR;
WLog_WARN(TAG, "TODO gdi_SurfaceCommand_Alpha: status: %"PRIu32"", status); WLog_WARN(TAG, "TODO gdi_SurfaceCommand_Alpha: status: %"PRIu32"", status);
/* fill with green for now to distinguish from the rest */ /* fill with green for now to distinguish from the rest */
color = GetColor(surface->format, 0x00, 0xFF, 0x00, 0xFF);
if (!freerdp_image_fill(surface->data, surface->format, surface->scanline, if (!freerdp_image_fill(surface->data, surface->format, surface->scanline,
cmd->left, cmd->top, cmd->width, cmd->height, 0x00FF00)) cmd->left, cmd->top, cmd->width, cmd->height, color))
return ERROR_INTERNAL_ERROR; return ERROR_INTERNAL_ERROR;
invalidRect.left = cmd->left; invalidRect.left = cmd->left;
@ -768,7 +770,9 @@ static UINT gdi_SolidFill(RdpgfxClientContext* context,
b = solidFill->fillPixel.B; b = solidFill->fillPixel.B;
g = solidFill->fillPixel.G; g = solidFill->fillPixel.G;
r = solidFill->fillPixel.R; r = solidFill->fillPixel.R;
a = solidFill->fillPixel.XA; /* a = solidFill->fillPixel.XA;
* Ignore alpha channel, this is a solid fill. */
a = 0xFF;
color = GetColor(surface->format, r, g, b, a); color = GetColor(surface->format, r, g, b, a);
for (index = 0; index < solidFill->fillRectCount; index++) for (index = 0; index < solidFill->fillRectCount; index++)
@ -780,8 +784,11 @@ static UINT gdi_SolidFill(RdpgfxClientContext* context,
invalidRect.top = rect->top; invalidRect.top = rect->top;
invalidRect.right = rect->right; invalidRect.right = rect->right;
invalidRect.bottom = rect->bottom; invalidRect.bottom = rect->bottom;
freerdp_image_fill(surface->data, surface->format, surface->scanline,
rect->left, rect->top, nWidth, nHeight, color); if (!freerdp_image_fill(surface->data, surface->format, surface->scanline,
rect->left, rect->top, nWidth, nHeight, color))
return ERROR_INTERNAL_ERROR;
region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion),
&invalidRect); &invalidRect);
} }
@ -834,12 +841,15 @@ static UINT gdi_SurfaceToSurface(RdpgfxClientContext* context,
for (index = 0; index < surfaceToSurface->destPtsCount; index++) for (index = 0; index < surfaceToSurface->destPtsCount; index++)
{ {
destPt = &surfaceToSurface->destPts[index]; destPt = &surfaceToSurface->destPts[index];
freerdp_image_copy(surfaceDst->data, surfaceDst->format,
surfaceDst->scanline, if (!freerdp_image_copy(surfaceDst->data, surfaceDst->format,
destPt->x, destPt->y, nWidth, nHeight, surfaceDst->scanline,
surfaceSrc->data, surfaceSrc->format, destPt->x, destPt->y, nWidth, nHeight,
surfaceSrc->scanline, surfaceSrc->data, surfaceSrc->format,
rectSrc->left, rectSrc->top, NULL, FREERDP_FLIP_NONE); surfaceSrc->scanline,
rectSrc->left, rectSrc->top, NULL, FREERDP_FLIP_NONE))
return ERROR_INTERNAL_ERROR;
invalidRect.left = destPt->x; invalidRect.left = destPt->x;
invalidRect.top = destPt->y; invalidRect.top = destPt->y;
invalidRect.right = destPt->x + rectSrc->right; invalidRect.right = destPt->x + rectSrc->right;
@ -892,9 +902,14 @@ static UINT gdi_SurfaceToCache(RdpgfxClientContext* context,
return ERROR_INTERNAL_ERROR; return ERROR_INTERNAL_ERROR;
} }
freerdp_image_copy(cacheEntry->data, cacheEntry->format, cacheEntry->scanline, if (!freerdp_image_copy(cacheEntry->data, cacheEntry->format, cacheEntry->scanline,
0, 0, cacheEntry->width, cacheEntry->height, surface->data, 0, 0, cacheEntry->width, cacheEntry->height, surface->data,
surface->format, surface->scanline, rect->left, rect->top, NULL, FREERDP_FLIP_NONE); surface->format, surface->scanline, rect->left, rect->top, NULL, FREERDP_FLIP_NONE))
{
free(cacheEntry);
return ERROR_INTERNAL_ERROR;
}
context->SetCacheSlotData(context, surfaceToCache->cacheSlot, context->SetCacheSlotData(context, surfaceToCache->cacheSlot,
(void*) cacheEntry); (void*) cacheEntry);
return CHANNEL_RC_OK; return CHANNEL_RC_OK;
@ -926,9 +941,13 @@ static UINT gdi_CacheToSurface(RdpgfxClientContext* context,
for (index = 0; index < cacheToSurface->destPtsCount; index++) for (index = 0; index < cacheToSurface->destPtsCount; index++)
{ {
destPt = &cacheToSurface->destPts[index]; destPt = &cacheToSurface->destPts[index];
freerdp_image_copy(surface->data, surface->format, surface->scanline,
destPt->x, destPt->y, cacheEntry->width, cacheEntry->height, if (!freerdp_image_copy(surface->data, surface->format, surface->scanline,
cacheEntry->data, cacheEntry->format, cacheEntry->scanline, 0, 0, NULL, FREERDP_FLIP_NONE); destPt->x, destPt->y, cacheEntry->width, cacheEntry->height,
cacheEntry->data, cacheEntry->format, cacheEntry->scanline,
0, 0, NULL, FREERDP_FLIP_NONE))
return ERROR_INTERNAL_ERROR;
invalidRect.left = destPt->x; invalidRect.left = destPt->x;
invalidRect.top = destPt->y; invalidRect.top = destPt->y;
invalidRect.right = destPt->x + cacheEntry->width - 1; invalidRect.right = destPt->x + cacheEntry->width - 1;