Skip to content

Commit e043621

Browse files
committed
Bug 1205913 - Differentiate YCbCr, NV12 and RGB textures when drawing layer borders. r=nical
--HG-- extra : rebase_source : cc0245929183231291f6fbb49bb7270a0a1e58e4
1 parent c360842 commit e043621

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

gfx/layers/Compositor.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,13 @@ Compositor::DrawDiagnosticsInternal(DiagnosticFlags aFlags,
111111
color = gfx::Color(0.0f, 1.0f, 1.0f, 1.0f); // greenish blue
112112
}
113113
} else if (aFlags & DiagnosticFlags::IMAGE) {
114-
color = gfx::Color(1.0f, 0.0f, 0.0f, 1.0f); // red
114+
if (aFlags & DiagnosticFlags::NV12) {
115+
color = gfx::Color(1.0f, 1.0f, 0.0f, 1.0f); // yellow
116+
} else if (aFlags & DiagnosticFlags::YCBCR) {
117+
color = gfx::Color(1.0f, 0.55f, 0.0f, 1.0f); // orange
118+
} else {
119+
color = gfx::Color(1.0f, 0.0f, 0.0f, 1.0f); // red
120+
}
115121
} else if (aFlags & DiagnosticFlags::COLOR) {
116122
color = gfx::Color(0.0f, 0.0f, 1.0f, 1.0f); // blue
117123
} else if (aFlags & DiagnosticFlags::CONTAINER) {

gfx/layers/CompositorTypes.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ enum class DiagnosticFlags : uint16_t {
107107
TILE = 1 << 5,
108108
BIGIMAGE = 1 << 6,
109109
COMPONENT_ALPHA = 1 << 7,
110-
REGION_RECT = 1 << 8
110+
REGION_RECT = 1 << 8,
111+
NV12 = 1 << 9,
112+
YCBCR = 1 << 10
111113
};
112114
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(DiagnosticFlags)
113115

gfx/layers/composite/ImageHost.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,13 @@ ImageHost::Composite(LayerComposite* aLayer,
316316
return;
317317
}
318318

319+
DiagnosticFlags diagnosticFlags = DiagnosticFlags::IMAGE;
320+
if (effect->mType == EffectTypes::NV12) {
321+
diagnosticFlags |= DiagnosticFlags::NV12;
322+
} else if (effect->mType == EffectTypes::YCBCR) {
323+
diagnosticFlags |= DiagnosticFlags::YCBCR;
324+
}
325+
319326
if (mLastFrameID != img->mFrameID || mLastProducerID != img->mProducerID) {
320327
if (mImageContainer) {
321328
aLayer->GetLayerManager()->
@@ -363,12 +370,12 @@ ImageHost::Composite(LayerComposite* aLayer,
363370
}
364371
GetCompositor()->DrawQuad(rect, aClipRect, aEffectChain,
365372
aOpacity, aTransform);
366-
GetCompositor()->DrawDiagnostics(DiagnosticFlags::IMAGE | DiagnosticFlags::BIGIMAGE,
373+
GetCompositor()->DrawDiagnostics(diagnosticFlags | DiagnosticFlags::BIGIMAGE,
367374
rect, aClipRect, aTransform, mFlashCounter);
368375
} while (it->NextTile());
369376
it->EndBigImageIteration();
370377
// layer border
371-
GetCompositor()->DrawDiagnostics(DiagnosticFlags::IMAGE, pictureRect,
378+
GetCompositor()->DrawDiagnostics(diagnosticFlags, pictureRect,
372379
aClipRect, aTransform, mFlashCounter);
373380
} else {
374381
IntSize textureSize = img->mTextureSource->GetSize();
@@ -384,7 +391,7 @@ ImageHost::Composite(LayerComposite* aLayer,
384391

385392
GetCompositor()->DrawQuad(pictureRect, aClipRect, aEffectChain,
386393
aOpacity, aTransform);
387-
GetCompositor()->DrawDiagnostics(DiagnosticFlags::IMAGE,
394+
GetCompositor()->DrawDiagnostics(diagnosticFlags,
388395
pictureRect, aClipRect,
389396
aTransform, mFlashCounter);
390397
}

0 commit comments

Comments
 (0)