Bug 1632310 [wpt PR 23186] - Add test for computed versus resolved style., a=testonly
[gecko.git] / gfx / layers / Effects.cpp
blob5c1551050dc9b88df4664d31ee357e455b8ede12
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/. */
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
13 using namespace mozilla::layers;
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=", "]");
21 if (mPremultiplied) {
22 aStream << " [premultiplied]";
23 } else {
24 aStream << " [not-premultiplied]";
27 AppendToString(aStream, mSamplingFilter, " [filter=", "]");
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=", "]");
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();
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();
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();
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=", "]");