gfx/layers/composite/ColorLayerComposite.cpp

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #include "ColorLayerComposite.h"
     7 #include "gfxColor.h"                   // for gfxRGBA
     8 #include "mozilla/RefPtr.h"             // for RefPtr
     9 #include "mozilla/gfx/Matrix.h"         // for Matrix4x4
    10 #include "mozilla/gfx/Point.h"          // for Point
    11 #include "mozilla/gfx/Rect.h"           // for Rect
    12 #include "mozilla/gfx/Types.h"          // for Color
    13 #include "mozilla/layers/Compositor.h"  // for Compositor
    14 #include "mozilla/layers/CompositorTypes.h"  // for DIAGNOSTIC_COLOR
    15 #include "mozilla/layers/Effects.h"     // for Effect, EffectChain, etc
    16 #include "mozilla/mozalloc.h"           // for operator delete, etc
    17 #include "nsPoint.h"                    // for nsIntPoint
    18 #include "nsRect.h"                     // for nsIntRect
    20 namespace mozilla {
    21 namespace layers {
    23 void
    24 ColorLayerComposite::RenderLayer(const nsIntRect& aClipRect)
    25 {
    26   EffectChain effects(this);
    27   gfxRGBA color(GetColor());
    28   effects.mPrimaryEffect = new EffectSolidColor(gfx::Color(color.r,
    29                                                            color.g,
    30                                                            color.b,
    31                                                            color.a));
    32   nsIntRect boundRect = GetBounds();
    34   LayerManagerComposite::AutoAddMaskEffect autoMaskEffect(GetMaskLayer(),
    35                                                           effects);
    37   gfx::Rect rect(boundRect.x, boundRect.y,
    38                  boundRect.width, boundRect.height);
    39   gfx::Rect clipRect(aClipRect.x, aClipRect.y,
    40                      aClipRect.width, aClipRect.height);
    42   float opacity = GetEffectiveOpacity();
    44   const gfx::Matrix4x4& transform = GetEffectiveTransform();
    45   mCompositor->DrawQuad(rect, clipRect, effects, opacity, transform);
    46   mCompositor->DrawDiagnostics(DIAGNOSTIC_COLOR,
    47                                rect, clipRect,
    48                                transform);
    49 }
    51 } /* layers */
    52 } /* mozilla */

mercurial