mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 334411: Introduce flashing invalidates areas when paint flashing is enabled. r=roc
This commit is contained in:
parent
a3bbb32ede
commit
1b8e035e99
@ -49,6 +49,8 @@
|
||||
#include "nsImageFrame.h"
|
||||
#include "nsRenderingContext.h"
|
||||
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
@ -470,6 +472,27 @@ FrameLayerBuilder::DisplayItemDataEntry::HasNonEmptyContainerLayer()
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
FrameLayerBuilder::FlashPaint(gfxContext *aContext)
|
||||
{
|
||||
static bool sPaintFlashingEnabled;
|
||||
static bool sPaintFlashingPrefCached = false;
|
||||
|
||||
if (!sPaintFlashingPrefCached) {
|
||||
sPaintFlashingPrefCached = true;
|
||||
mozilla::Preferences::AddBoolVarCache(&sPaintFlashingEnabled,
|
||||
"nglayout.debug.paint_flashing");
|
||||
}
|
||||
|
||||
if (sPaintFlashingEnabled) {
|
||||
float r = float(rand()) / RAND_MAX;
|
||||
float g = float(rand()) / RAND_MAX;
|
||||
float b = float(rand()) / RAND_MAX;
|
||||
aContext->SetColor(gfxRGBA(r, g, b, 0.2));
|
||||
aContext->Paint();
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ nsTArray<FrameLayerBuilder::DisplayItemData>*
|
||||
FrameLayerBuilder::GetDisplayItemDataArrayForFrame(nsIFrame* aFrame)
|
||||
{
|
||||
@ -2127,6 +2150,8 @@ FrameLayerBuilder::DrawThebesLayer(ThebesLayer* aLayer,
|
||||
if (setClipRect) {
|
||||
aContext->Restore();
|
||||
}
|
||||
|
||||
FlashPaint(aContext);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -441,6 +441,9 @@ protected:
|
||||
// LayerManagerData needs to see DisplayItemDataEntry.
|
||||
friend class LayerManagerData;
|
||||
|
||||
// Flash the area within the context clip if paint flashing is enabled.
|
||||
static void FlashPaint(gfxContext *aContext);
|
||||
|
||||
/*
|
||||
* Get the DisplayItemData array associated with this frame, or null if one
|
||||
* doesn't exist.
|
||||
|
Loading…
Reference in New Issue
Block a user