mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 539356 - Part 6 - Add compositing paint flashing to BasicLayers. r=roc
This commit is contained in:
parent
e15259b14a
commit
1593e158d4
@ -11,6 +11,7 @@
|
||||
#include "mozilla/layers/PLayersChild.h"
|
||||
#include "mozilla/layers/PLayersParent.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
#include "ipc/ShadowLayerChild.h"
|
||||
|
||||
@ -1676,6 +1677,9 @@ BasicLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
}
|
||||
|
||||
PaintLayer(mTarget, mRoot, aCallback, aCallbackData, nsnull);
|
||||
if (mWidget) {
|
||||
FlashWidgetUpdateArea(mTarget);
|
||||
}
|
||||
|
||||
if (!mTransactionIncomplete) {
|
||||
// Clear out target if we have a complete transaction.
|
||||
@ -1706,6 +1710,27 @@ BasicLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
return !mTransactionIncomplete;
|
||||
}
|
||||
|
||||
void
|
||||
BasicLayerManager::FlashWidgetUpdateArea(gfxContext *aContext)
|
||||
{
|
||||
static bool sWidgetFlashingEnabled;
|
||||
static bool sWidgetFlashingPrefCached = false;
|
||||
|
||||
if (!sWidgetFlashingPrefCached) {
|
||||
sWidgetFlashingPrefCached = true;
|
||||
mozilla::Preferences::AddBoolVarCache(&sWidgetFlashingEnabled,
|
||||
"nglayout.debug.widget_update_flashing");
|
||||
}
|
||||
|
||||
if (sWidgetFlashingEnabled) {
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
BasicLayerManager::EndEmptyTransaction()
|
||||
{
|
||||
|
@ -172,6 +172,8 @@ protected:
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags = END_DEFAULT);
|
||||
|
||||
void FlashWidgetUpdateArea(gfxContext* aContext);
|
||||
|
||||
// Widget whose surface should be used as the basis for ThebesLayer
|
||||
// buffers.
|
||||
nsIWidget* mWidget;
|
||||
|
@ -339,6 +339,10 @@ pref("nglayout.enable_drag_images", true);
|
||||
// enable/disable paint flashing --- useful for debugging
|
||||
pref("nglayout.debug.paint_flashing", false);
|
||||
|
||||
// enable/disable widget update area flashing --- only supported with
|
||||
// BasicLayers (other layer managers always update the entire widget area)
|
||||
pref("nglayout.debug.widget_update_flashing", false);
|
||||
|
||||
// scrollbar snapping region
|
||||
// 0 - off
|
||||
// 1 and higher - slider thickness multiple
|
||||
|
Loading…
Reference in New Issue
Block a user