Bug 539356 - Part 6 - Add compositing paint flashing to BasicLayers. r=roc
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "BasicLayersImpl.h"
|
||||
#include "BasicThebesLayer.h"
|
||||
#include "BasicContainerLayer.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
@@ -434,6 +435,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.
|
||||
@@ -466,6 +470,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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user