Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
* License, v. 2.0. If a copy of the MPL was not distributed with this
5
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#include "Effects.h"
8
#include "LayersLogging.h" // for AppendToString
9
#include "nsAString.h"
10
#include "nsPrintfCString.h" // for nsPrintfCString
11
#include "nsString.h" // for nsAutoCString
12
13
using namespace mozilla::layers;
14
15
void TexturedEffect::PrintInfo(std::stringstream& aStream,
16
const char* aPrefix) {
17
aStream << aPrefix;
18
aStream << nsPrintfCString("%s (0x%p)", Name(), this).get();
19
AppendToString(aStream, mTextureCoords, " [texture-coords=", "]");
20
21
if (mPremultiplied) {
22
aStream << " [premultiplied]";
23
} else {
24
aStream << " [not-premultiplied]";
25
}
26
27
AppendToString(aStream, mSamplingFilter, " [filter=", "]");
28
}
29
30
void EffectMask::PrintInfo(std::stringstream& aStream, const char* aPrefix) {
31
aStream << aPrefix;
32
aStream << nsPrintfCString("EffectMask (0x%p)", this).get();
33
AppendToString(aStream, mSize, " [size=", "]");
34
AppendToString(aStream, mMaskTransform, " [mask-transform=", "]");
35
}
36
37
void EffectRenderTarget::PrintInfo(std::stringstream& aStream,
38
const char* aPrefix) {
39
TexturedEffect::PrintInfo(aStream, aPrefix);
40
aStream << nsPrintfCString(" [render-target=%p]", mRenderTarget.get()).get();
41
}
42
43
void EffectSolidColor::PrintInfo(std::stringstream& aStream,
44
const char* aPrefix) {
45
aStream << aPrefix;
46
aStream << nsPrintfCString("EffectSolidColor (0x%p) [color=%x]", this,
47
mColor.ToABGR())
48
.get();
49
}
50
51
void EffectBlendMode::PrintInfo(std::stringstream& aStream,
52
const char* aPrefix) {
53
aStream << aPrefix;
54
aStream << nsPrintfCString("EffectBlendMode (0x%p) [blendmode=%i]", this,
55
(int)mBlendMode)
56
.get();
57
}
58
59
void EffectColorMatrix::PrintInfo(std::stringstream& aStream,
60
const char* aPrefix) {
61
aStream << aPrefix;
62
aStream << nsPrintfCString("EffectColorMatrix (0x%p)", this).get();
63
AppendToString(aStream, mColorMatrix, " [matrix=", "]");
64
}