mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 892966 - Don't rely on being able to retrieve the current surface from a gfxContext when drawing cocoa menus. r=jrmuizel
This commit is contained in:
parent
704e428266
commit
71aa4e5c5d
@ -33,6 +33,8 @@
|
|||||||
#include "gfxQuartzNativeDrawing.h"
|
#include "gfxQuartzNativeDrawing.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
using namespace mozilla::gfx;
|
||||||
|
|
||||||
#define DRAW_IN_FRAME_DEBUG 0
|
#define DRAW_IN_FRAME_DEBUG 0
|
||||||
#define SCROLLBARS_VISUAL_DEBUG 0
|
#define SCROLLBARS_VISUAL_DEBUG 0
|
||||||
|
|
||||||
@ -2038,7 +2040,15 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case NS_THEME_MENUITEM: {
|
case NS_THEME_MENUITEM: {
|
||||||
if (thebesCtx->OriginalSurface()->GetContentType() == gfxASurface::CONTENT_COLOR_ALPHA) {
|
bool isTransparent;
|
||||||
|
if (thebesCtx->IsCairo()) {
|
||||||
|
isTransparent = thebesCtx->OriginalSurface()->GetContentType() == gfxASurface::CONTENT_COLOR_ALPHA;
|
||||||
|
} else {
|
||||||
|
SurfaceFormat format = thebesCtx->GetDrawTarget()->GetFormat();
|
||||||
|
isTransparent = (format == FORMAT_R8G8B8A8) ||
|
||||||
|
(format == FORMAT_B8G8R8A8);
|
||||||
|
}
|
||||||
|
if (isTransparent) {
|
||||||
// Clear the background to get correct transparency.
|
// Clear the background to get correct transparency.
|
||||||
CGContextClearRect(cgContext, macRect);
|
CGContextClearRect(cgContext, macRect);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user