Find changesets by keywords (author, files, the commit message), revision
number or hash, or revset expression.

Bug 612840. Part 1: Remove CONTENT_NO_TEXT flag since it's not really used. Also remove ShouldRetainTransparentSurface and related code; we'll assume that when text is over opaque pixels in an RGBA surface we can always paint it with subpixel AA --- and make it so in later patches. r=vlad

Bug 612840. Part 1: Remove CONTENT_NO_TEXT flag since it's not really used. Also remove ShouldRetainTransparentSurface and related code; we'll assume that when text is over opaque pixels in an RGBA surface we can always paint it with subpixel AA --- and make it so in later patches. r=vlad

--- a/gfx/layers/Layers.h+++ b/gfx/layers/Layers.h@@ -479,27 +479,20 @@ public: * If this is set, the caller is promising that by the end of this * transaction the entire visible region (as specified by * SetVisibleRegion) will be filled with opaque content. */ CONTENT_OPAQUE = 0x01, /** * ThebesLayers only! * If this is set, the caller is promising that the visible region- * contains no text at all. If this is set,- * CONTENT_NO_TEXT_OVER_TRANSPARENT will also be set.- */- CONTENT_NO_TEXT = 0x02,- /**- * ThebesLayers only!- * If this is set, the caller is promising that the visible region * contains no text over transparent pixels (any text, if present, * is over fully opaque pixels). */- CONTENT_NO_TEXT_OVER_TRANSPARENT = 0x04+ CONTENT_NO_TEXT_OVER_TRANSPARENT = 0x02 }; /** * CONSTRUCTION PHASE ONLY * This lets layout make some promises about what will be drawn into the * visible region of the ThebesLayer. This enables internal quality * and performance optimizations. */ void SetContentFlags(PRUint32 aFlags)

--- a/gfx/thebes/gfxASurface.h+++ b/gfx/thebes/gfxASurface.h@@ -155,49 +155,16 @@ public: * This will not copy image data, just wraps an image surface around * pixel data already available in memory. */ virtual already_AddRefed<gfxImageSurface> GetAsImageSurface() { return nsnull; }- enum TextQuality {- /**- * TEXT_QUALITY_OK means that text is always rendered to a- * transparent surface just as well as it would be rendered to an- * opaque surface. This would normally only be true if- * subpixel antialiasing is disabled or if the platform's- * transparent surfaces support component alpha.- */- TEXT_QUALITY_OK,- /**- * TEXT_QUALITY_OK_OVER_OPAQUE_PIXELS means that text is rendered- * to a transparent surface just as well as it would be rendered to an- * opaque surface, but only if all the pixels the text is drawn- * over already have opaque alpha values.- */- TEXT_QUALITY_OK_OVER_OPAQUE_PIXELS,- /**- * TEXT_QUALITY_BAD means that text is rendered- * to a transparent surface worse than it would be rendered to an- * opaque surface, even if all the pixels the text is drawn- * over already have opaque alpha values.- */- TEXT_QUALITY_BAD- };- /**- * Determine how well text would be rendered in transparent surfaces that- * are similar to this surface.- */- virtual TextQuality GetTextQualityInTransparentSurfaces()- {- return TEXT_QUALITY_BAD;- }- int CairoStatus(); /* Make sure that the given dimensions don't overflow a 32-bit signed int * using 4 bytes per pixel; optionally, make sure that either dimension * doesn't exceed the given limit. */ static PRBool CheckSurfaceSize(const gfxIntSize& sz, PRInt32 limit = 0);

--- a/layout/base/FrameLayerBuilder.cpp+++ b/layout/base/FrameLayerBuilder.cpp@@ -161,17 +161,17 @@ protected: * makes it more likely a display item will be rendered to an opaque * layer, giving us the best chance of getting subpixel AA. */ class ThebesLayerData { public: ThebesLayerData() : mActiveScrolledRoot(nsnull), mLayer(nsnull), mIsSolidColorInVisibleRegion(PR_FALSE),- mHasText(PR_FALSE), mHasTextOverTransparent(PR_FALSE),+ mHasTextOverTransparent(PR_FALSE), mForceTransparentSurface(PR_FALSE) {} /** * Record that an item has been added to the ThebesLayer, so we * need to update our regions. * @param aVisibleRect the area of the item that's visible * @param aDrawRect the area of the item that would be drawn if it * was completely visible * @param aOpaqueRect if non-null, the area of the item that's opaque.@@ -232,20 +232,16 @@ protected: * region. */ nscolor mSolidColor; /** * True if every pixel in mVisibleRegion will have color mSolidColor. */ PRPackedBool mIsSolidColorInVisibleRegion; /**- * True if there is any text visible in the layer.- */- PRPackedBool mHasText;- /** * True if there is any text visible in the layer that's over * transparent pixels in the layer. */ PRPackedBool mHasTextOverTransparent; /** * Set if the layer should be treated as transparent, even if its entire * area is covered by opaque display items. For example, this needs to * be set if something is going to "punch holes" in the layer by clearing@@ -866,17 +862,16 @@ ContainerState::PopThebesLayerData() // Invalidate the entire target ThebesLayer since we're changing // the background color data->mLayer->InvalidateRegion(data->mLayer->GetValidRegion()); } userData->mForcedBackgroundColor = backgroundColor; } PRUint32 flags = ((isOpaque && !data->mForceTransparentSurface) ? Layer::CONTENT_OPAQUE : 0) |- (data->mHasText ? 0 : Layer::CONTENT_NO_TEXT) | (data->mHasTextOverTransparent ? 0 : Layer::CONTENT_NO_TEXT_OVER_TRANSPARENT); layer->SetContentFlags(flags); if (lastIndex > 0) { // Since we're going to pop off the last ThebesLayerData, the // mVisibleAboveRegion of the second-to-last item will need to include // the regions of the last item. ThebesLayerData* nextData = mThebesLayerDataStack[lastIndex - 1];@@ -929,17 +924,16 @@ ContainerState::ThebesLayerData::Accumul // a canvas background), so we need to make sure that the first rect // we see doesn't get discarded. nsIntRegion tmp; tmp.Or(mOpaqueRegion, aDrawRect); if (tmp.GetNumRects() <= 4) { mOpaqueRegion = tmp; } } else if (aItem->HasText()) {- mHasText = PR_TRUE; if (!mOpaqueRegion.Contains(aVisibleRect)) { mHasTextOverTransparent = PR_TRUE; } } mForceTransparentSurface = mForceTransparentSurface || forceTransparentSurface; } already_AddRefed<ThebesLayer>