gfx/layers/Effects.cpp

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     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 "Effects.h"
     7 #include "LayersLogging.h"              // for AppendToString
     8 #include "nsAString.h"
     9 #include "nsPrintfCString.h"            // for nsPrintfCString
    10 #include "nsString.h"                   // for nsAutoCString
    12 using namespace mozilla::layers;
    14 void
    15 TexturedEffect::PrintInfo(nsACString& aTo, const char* aPrefix)
    16 {
    17   aTo += aPrefix;
    18   aTo += nsPrintfCString("%s (0x%p)", Name(), this);
    19   AppendToString(aTo, mTextureCoords, " [texture-coords=", "]");
    21   if (mPremultiplied) {
    22     aTo += " [premultiplied]";
    23   } else {
    24     aTo += " [not-premultiplied]";
    25   }
    27   AppendToString(aTo, mFilter, " [filter=", "]");
    28 }
    30 void
    31 EffectMask::PrintInfo(nsACString& aTo, const char* aPrefix)
    32 {
    33   aTo += aPrefix;
    34   aTo += nsPrintfCString("EffectMask (0x%p)", this);
    35   AppendToString(aTo, mSize, " [size=", "]");
    36   AppendToString(aTo, mMaskTransform, " [mask-transform=", "]");
    38   if (mIs3D) {
    39     aTo += " [is-3d]";
    40   }
    41 }
    43 void
    44 EffectRenderTarget::PrintInfo(nsACString& aTo, const char* aPrefix)
    45 {
    46   TexturedEffect::PrintInfo(aTo, aPrefix);
    47   aTo += nsPrintfCString(" [render-target=%p]", mRenderTarget.get());
    48 }
    50 void
    51 EffectSolidColor::PrintInfo(nsACString& aTo, const char* aPrefix)
    52 {
    53   aTo += aPrefix;
    54   aTo += nsPrintfCString("EffectSolidColor (0x%p) [color=%x]", this, mColor.ToABGR());
    55 }

mercurial