diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-07-06 15:53:52 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-07-06 15:53:52 +0200 |
commit | 941e54654eabed0a3568f7fefe424a45aa02eddb (patch) | |
tree | 49aa02b174c428962d99142d8061267bfcd79e69 /gfx/layers | |
parent | ad9ee72dcd7981bc47b3844a224d69fadfdfd8ef (diff) | |
parent | 0daa12376295d5d796256a116eb2a348a3a9273f (diff) | |
download | UXP-941e54654eabed0a3568f7fefe424a45aa02eddb.tar UXP-941e54654eabed0a3568f7fefe424a45aa02eddb.tar.gz UXP-941e54654eabed0a3568f7fefe424a45aa02eddb.tar.lz UXP-941e54654eabed0a3568f7fefe424a45aa02eddb.tar.xz UXP-941e54654eabed0a3568f7fefe424a45aa02eddb.zip |
Merge branch 'master' of https://github.com/MoonchildProductions/UXP into _testBranch_test_1
Diffstat (limited to 'gfx/layers')
-rw-r--r-- | gfx/layers/Compositor.cpp | 4 | ||||
-rw-r--r-- | gfx/layers/ImageDataSerializer.cpp | 35 | ||||
-rw-r--r-- | gfx/layers/ImageDataSerializer.h | 6 | ||||
-rw-r--r-- | gfx/layers/apz/src/APZCTreeManager.cpp | 1 | ||||
-rw-r--r-- | gfx/layers/basic/BasicCompositor.cpp | 14 | ||||
-rwxr-xr-x | gfx/layers/composite/ContainerLayerComposite.cpp | 24 | ||||
-rw-r--r-- | gfx/layers/composite/TextureHost.cpp | 9 | ||||
-rw-r--r-- | gfx/layers/d3d11/CompositorD3D11.cpp | 4 | ||||
-rw-r--r-- | gfx/layers/d3d9/CompositorD3D9.cpp | 5 | ||||
-rw-r--r-- | gfx/layers/ipc/CompositorBridgeParent.cpp | 9 | ||||
-rw-r--r-- | gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp | 3 | ||||
-rw-r--r-- | gfx/layers/ipc/ImageBridgeChild.cpp | 14 | ||||
-rw-r--r-- | gfx/layers/ipc/LayerTransactionChild.cpp | 9 | ||||
-rw-r--r-- | gfx/layers/opengl/CompositingRenderTargetOGL.cpp | 2 | ||||
-rw-r--r-- | gfx/layers/opengl/CompositingRenderTargetOGL.h | 2 | ||||
-rw-r--r-- | gfx/layers/opengl/CompositorOGL.cpp | 5 | ||||
-rw-r--r-- | gfx/layers/opengl/TextureHostOGL.cpp | 4 |
17 files changed, 59 insertions, 91 deletions
diff --git a/gfx/layers/Compositor.cpp b/gfx/layers/Compositor.cpp index ce7eb9008..b623b8de9 100644 --- a/gfx/layers/Compositor.cpp +++ b/gfx/layers/Compositor.cpp @@ -173,9 +173,7 @@ Compositor::DrawDiagnosticsInternal(DiagnosticFlags aFlags, const gfx::Matrix4x4& aTransform, uint32_t aFlashCounter) { -#ifdef MOZ_B2G - int lWidth = 4; -#elif defined(ANDROID) +#if defined(ANDROID) int lWidth = 10; #else int lWidth = 2; diff --git a/gfx/layers/ImageDataSerializer.cpp b/gfx/layers/ImageDataSerializer.cpp index 08ed83bd9..db11e903c 100644 --- a/gfx/layers/ImageDataSerializer.cpp +++ b/gfx/layers/ImageDataSerializer.cpp @@ -84,6 +84,41 @@ ComputeYCbCrBufferSize(const gfx::IntSize& aYSize, const gfx::IntSize& aCbCrSize } uint32_t +ComputeYCbCrBufferSize(const gfx::IntSize& aYSize, const gfx::IntSize& aCbCrSize, + uint32_t aYOffset, uint32_t aCbOffset, uint32_t aCrOffset) +{ + MOZ_ASSERT(aYSize.height >= 0 && aYSize.width >= 0); + + int32_t yStride = aYSize.width; + int32_t cbCrStride = aCbCrSize.width; + if (aYSize.height < 0 || aYSize.width < 0 || aCbCrSize.height < 0 || aCbCrSize.width < 0 || + !gfx::Factory::AllowedSurfaceSize(IntSize(yStride, aYSize.height)) || + !gfx::Factory::AllowedSurfaceSize(IntSize(cbCrStride, aCbCrSize.height))) { + return 0; + } + + uint32_t yLength = GetAlignedStride<4>(yStride, aYSize.height); + uint32_t cbCrLength = GetAlignedStride<4>(cbCrStride, aCbCrSize.height); + if (yLength == 0 || cbCrLength == 0) { + return 0; + } + + CheckedInt<uint32_t> yEnd = aYOffset; + yEnd += yLength; + CheckedInt<uint32_t> cbEnd = aCbOffset; + cbEnd += cbCrLength; + CheckedInt<uint32_t> crEnd = aCrOffset; + crEnd += cbCrLength; + + if (!yEnd.isValid() || !cbEnd.isValid() || !crEnd.isValid() || + yEnd.value() > aCbOffset || cbEnd.value() > aCrOffset) { + return 0; + } + + return crEnd.value(); +} + +uint32_t ComputeYCbCrBufferSize(uint32_t aBufferSize) { return GetAlignedStride<4>(aBufferSize, 1); diff --git a/gfx/layers/ImageDataSerializer.h b/gfx/layers/ImageDataSerializer.h index 53a589d21..4b3194b0c 100644 --- a/gfx/layers/ImageDataSerializer.h +++ b/gfx/layers/ImageDataSerializer.h @@ -47,7 +47,11 @@ uint32_t ComputeYCbCrBufferSize(const gfx::IntSize& aYSize, int32_t aCbCrStride); uint32_t ComputeYCbCrBufferSize(const gfx::IntSize& aYSize, const gfx::IntSize& aCbCrSize); - +uint32_t ComputeYCbCrBufferSize(const gfx::IntSize& aYSize, + const gfx::IntSize& aCbCrSize, + uint32_t aYOffset, + uint32_t aCbOffset, + uint32_t aCrOffset); uint32_t ComputeYCbCrBufferSize(uint32_t aBufferSize); void ComputeYCbCrOffsets(int32_t yStride, int32_t yHeight, diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index 857ae5958..f54326360 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -1145,6 +1145,7 @@ APZCTreeManager::UpdateWheelTransaction(LayoutDeviceIntPoint aRefPoint, case eMouseUp: case eMouseDown: case eMouseDoubleClick: + case eMouseAuxClick: case eMouseClick: case eContextMenu: case eDrop: diff --git a/gfx/layers/basic/BasicCompositor.cpp b/gfx/layers/basic/BasicCompositor.cpp index 1ff27f795..634d9e340 100644 --- a/gfx/layers/basic/BasicCompositor.cpp +++ b/gfx/layers/basic/BasicCompositor.cpp @@ -470,15 +470,15 @@ AttemptVideoScale(TextureSourceBasic* aSource, const SourceSurface* aSourceMask, RefPtr<DataSourceSurface> srcSource = aSource->GetSurface(aDest)->GetDataSurface(); DataSourceSurface::ScopedMap mapSrc(srcSource, DataSourceSurface::READ); - ssse3_scale_data((uint32_t*)mapSrc.GetData(), srcSource->GetSize().width, srcSource->GetSize().height, - mapSrc.GetStride()/4, - ((uint32_t*)dstData) + fillRect.x + (dstStride / 4) * fillRect.y, dstRect.width, dstRect.height, - dstStride / 4, - offset.x, offset.y, - fillRect.width, fillRect.height); + bool success = ssse3_scale_data((uint32_t*)mapSrc.GetData(), srcSource->GetSize().width, srcSource->GetSize().height, + mapSrc.GetStride()/4, + ((uint32_t*)dstData) + fillRect.x + (dstStride / 4) * fillRect.y, dstRect.width, dstRect.height, + dstStride / 4, + offset.x, offset.y, + fillRect.width, fillRect.height); aDest->ReleaseBits(dstData); - return true; + return success; } else #endif // MOZILLA_SSE_HAVE_CPUID_DETECTION return false; diff --git a/gfx/layers/composite/ContainerLayerComposite.cpp b/gfx/layers/composite/ContainerLayerComposite.cpp index 35070cad6..f25503532 100755 --- a/gfx/layers/composite/ContainerLayerComposite.cpp +++ b/gfx/layers/composite/ContainerLayerComposite.cpp @@ -35,9 +35,6 @@ #include "TextRenderer.h" // for TextRenderer #include <vector> #include "GeckoProfiler.h" // for GeckoProfiler -#ifdef MOZ_ENABLE_PROFILER_SPS -#include "ProfilerMarkers.h" // for ProfilerMarkers -#endif #define CULLING_LOG(...) // #define CULLING_LOG(...) printf_stderr("CULLING: " __VA_ARGS__) @@ -86,26 +83,7 @@ static gfx::IntRect ContainerVisibleRect(ContainerT* aContainer) static void PrintUniformityInfo(Layer* aLayer) { -#ifdef MOZ_ENABLE_PROFILER_SPS - if (!profiler_is_active()) { - return; - } - - // Don't want to print a log for smaller layers - if (aLayer->GetLocalVisibleRegion().GetBounds().width < 300 || - aLayer->GetLocalVisibleRegion().GetBounds().height < 300) { - return; - } - - Matrix4x4 transform = aLayer->AsLayerComposite()->GetShadowBaseTransform(); - if (!transform.Is2D()) { - return; - } - - Point translation = transform.As2D().GetTranslation(); - LayerTranslationPayload* payload = new LayerTranslationPayload(aLayer, translation); - PROFILER_MARKER_PAYLOAD("LayerTranslation", payload); -#endif + /*** STUB ***/ } /* all of the per-layer prepared data we need to maintain */ diff --git a/gfx/layers/composite/TextureHost.cpp b/gfx/layers/composite/TextureHost.cpp index e7d87e238..e4a2ffd86 100644 --- a/gfx/layers/composite/TextureHost.cpp +++ b/gfx/layers/composite/TextureHost.cpp @@ -259,7 +259,9 @@ CreateBackendIndependentTextureHost(const SurfaceDescriptor& aDesc, case BufferDescriptor::TYCbCrDescriptor: { const YCbCrDescriptor& ycbcr = desc.get_YCbCrDescriptor(); reqSize = - ImageDataSerializer::ComputeYCbCrBufferSize(ycbcr.ySize(), ycbcr.cbCrSize()); + ImageDataSerializer::ComputeYCbCrBufferSize(ycbcr.ySize(), ycbcr.cbCrSize(), + ycbcr.yOffset(), ycbcr.cbOffset(), + ycbcr.crOffset()); break; } case BufferDescriptor::TRGBDescriptor: { @@ -272,7 +274,7 @@ CreateBackendIndependentTextureHost(const SurfaceDescriptor& aDesc, MOZ_CRASH("GFX: Bad descriptor"); } - if (bufSize < reqSize) { + if (reqSize == 0 || bufSize < reqSize) { NS_ERROR("A client process gave a shmem too small to fit for its descriptor!"); return nullptr; } @@ -888,8 +890,7 @@ BufferTextureHost::Upload(nsIntRegion *aRegion) mFirstSource = mCompositor->CreateDataTextureSource(mFlags|TextureFlags::RGB_FROM_YCBCR); mFirstSource->SetOwner(this); } - mFirstSource->Update(surf, aRegion); - return true; + return mFirstSource->Update(surf, aRegion); } RefPtr<DataTextureSource> srcY; diff --git a/gfx/layers/d3d11/CompositorD3D11.cpp b/gfx/layers/d3d11/CompositorD3D11.cpp index 540d39b33..2197f5444 100644 --- a/gfx/layers/d3d11/CompositorD3D11.cpp +++ b/gfx/layers/d3d11/CompositorD3D11.cpp @@ -19,7 +19,6 @@ #include "nsWindowsHelpers.h" #include "gfxPrefs.h" #include "gfxConfig.h" -#include "gfxCrashReporterUtils.h" #include "gfxUtils.h" #include "mozilla/gfx/StackArray.h" #include "mozilla/Services.h" @@ -181,8 +180,6 @@ CompositorD3D11::~CompositorD3D11() bool CompositorD3D11::Initialize(nsCString* const out_failureReason) { - ScopedGfxFeatureReporter reporter("D3D11 Layers"); - MOZ_ASSERT(gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)); HRESULT hr; @@ -415,7 +412,6 @@ CompositorD3D11::Initialize(nsCString* const out_failureReason) mAllowPartialPresents = CanUsePartialPresents(mDevice); - reporter.SetSuccessful(); return true; } diff --git a/gfx/layers/d3d9/CompositorD3D9.cpp b/gfx/layers/d3d9/CompositorD3D9.cpp index 0f7e942c1..85c19139f 100644 --- a/gfx/layers/d3d9/CompositorD3D9.cpp +++ b/gfx/layers/d3d9/CompositorD3D9.cpp @@ -15,7 +15,6 @@ #include "gfxFailure.h" #include "mozilla/layers/LayerManagerComposite.h" #include "gfxPrefs.h" -#include "gfxCrashReporterUtils.h" #include "gfxUtils.h" #include "mozilla/gfx/DeviceManagerDx.h" #include "mozilla/layers/CompositorBridgeParent.h" @@ -43,8 +42,6 @@ CompositorD3D9::~CompositorD3D9() bool CompositorD3D9::Initialize(nsCString* const out_failureReason) { - ScopedGfxFeatureReporter reporter("D3D9 Layers"); - mDeviceManager = DeviceManagerD3D9::Get(); if (!mDeviceManager) { *out_failureReason = "FEATURE_FAILURE_D3D9_DEVICE_MANAGER"; @@ -62,8 +59,6 @@ CompositorD3D9::Initialize(nsCString* const out_failureReason) return false; } - reporter.SetSuccessful(); - return true; } diff --git a/gfx/layers/ipc/CompositorBridgeParent.cpp b/gfx/layers/ipc/CompositorBridgeParent.cpp index 6728e8841..bf510cd46 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.cpp +++ b/gfx/layers/ipc/CompositorBridgeParent.cpp @@ -74,9 +74,6 @@ #include "mozilla/HalTypes.h" #include "mozilla/StaticPtr.h" #include "mozilla/Telemetry.h" -#ifdef MOZ_ENABLE_PROFILER_SPS -#include "ProfilerMarkers.h" -#endif #include "mozilla/VsyncDispatcher.h" #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) #include "VsyncSource.h" @@ -1923,11 +1920,7 @@ CompositorBridgeParent::GetAPZCTreeManager(uint64_t aLayersId) static void InsertVsyncProfilerMarker(TimeStamp aVsyncTimestamp) { -#ifdef MOZ_ENABLE_PROFILER_SPS - MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread()); - VsyncPayload* payload = new VsyncPayload(aVsyncTimestamp); - PROFILER_MARKER_PAYLOAD("VsyncTimestamp", payload); -#endif + /*** STUB ***/ } /*static */ void diff --git a/gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp b/gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp index 1bb6d046b..c3ea33149 100644 --- a/gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp +++ b/gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp @@ -73,9 +73,6 @@ #include "mozilla/HalTypes.h" #include "mozilla/StaticPtr.h" #include "mozilla/Telemetry.h" -#ifdef MOZ_ENABLE_PROFILER_SPS -#include "ProfilerMarkers.h" -#endif #include "mozilla/VsyncDispatcher.h" #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) #include "VsyncSource.h" diff --git a/gfx/layers/ipc/ImageBridgeChild.cpp b/gfx/layers/ipc/ImageBridgeChild.cpp index 0466a1031..efd7a0162 100644 --- a/gfx/layers/ipc/ImageBridgeChild.cpp +++ b/gfx/layers/ipc/ImageBridgeChild.cpp @@ -73,24 +73,10 @@ protected: MOZ_IS_CLASS_INIT void Init() { -#ifdef MOZ_ENABLE_PROFILER_SPS - mPseudoStackHack = mozilla_get_pseudo_stack(); -#endif } void CleanUp() { -#ifdef MOZ_ENABLE_PROFILER_SPS - mPseudoStackHack = nullptr; -#endif } - -private: - -#ifdef MOZ_ENABLE_PROFILER_SPS - // This is needed to avoid a spurious leak report. There's no other - // use for it. See bug 1239504 and bug 1215265. - MOZ_INIT_OUTSIDE_CTOR PseudoStack* mPseudoStackHack; -#endif }; } diff --git a/gfx/layers/ipc/LayerTransactionChild.cpp b/gfx/layers/ipc/LayerTransactionChild.cpp index 8b60d3b51..f07e2c27f 100644 --- a/gfx/layers/ipc/LayerTransactionChild.cpp +++ b/gfx/layers/ipc/LayerTransactionChild.cpp @@ -72,15 +72,6 @@ void LayerTransactionChild::ActorDestroy(ActorDestroyReason why) { mDestroyed = true; -#ifdef MOZ_B2G - // Due to poor lifetime management of gralloc (and possibly shmems) we will - // crash at some point in the future when we get destroyed due to abnormal - // shutdown. Its better just to crash here. On desktop though, we have a chance - // of recovering. - if (why == AbnormalShutdown) { - NS_RUNTIMEABORT("ActorDestroy by IPC channel failure at LayerTransactionChild"); - } -#endif } } // namespace layers diff --git a/gfx/layers/opengl/CompositingRenderTargetOGL.cpp b/gfx/layers/opengl/CompositingRenderTargetOGL.cpp index c05b8edfd..a1521c56d 100644 --- a/gfx/layers/opengl/CompositingRenderTargetOGL.cpp +++ b/gfx/layers/opengl/CompositingRenderTargetOGL.cpp @@ -60,7 +60,7 @@ CompositingRenderTargetOGL::BindRenderTarget() msg.AppendPrintf("Framebuffer not complete -- CheckFramebufferStatus returned 0x%x, " "GLContext=%p, IsOffscreen()=%d, mFBO=%d, aFBOTextureTarget=0x%x, " "aRect.width=%d, aRect.height=%d", - result, mGL, mGL->IsOffscreen(), mFBO, mInitParams.mFBOTextureTarget, + result, mGL.get(), mGL->IsOffscreen(), mFBO, mInitParams.mFBOTextureTarget, mInitParams.mSize.width, mInitParams.mSize.height); NS_WARNING(msg.get()); } diff --git a/gfx/layers/opengl/CompositingRenderTargetOGL.h b/gfx/layers/opengl/CompositingRenderTargetOGL.h index 501701d6f..071dc5cac 100644 --- a/gfx/layers/opengl/CompositingRenderTargetOGL.h +++ b/gfx/layers/opengl/CompositingRenderTargetOGL.h @@ -184,7 +184,7 @@ private: * the target is always cleared at the end of a frame. */ RefPtr<CompositorOGL> mCompositor; - GLContext* mGL; + RefPtr<GLContext> mGL; GLuint mTextureHandle; GLuint mFBO; }; diff --git a/gfx/layers/opengl/CompositorOGL.cpp b/gfx/layers/opengl/CompositorOGL.cpp index bbe1b4657..93656d72a 100644 --- a/gfx/layers/opengl/CompositorOGL.cpp +++ b/gfx/layers/opengl/CompositorOGL.cpp @@ -12,7 +12,6 @@ #include "GLUploadHelpers.h" #include "Layers.h" // for WriteSnapshotToDumpFile #include "LayerScope.h" // for LayerScope -#include "gfxCrashReporterUtils.h" // for ScopedGfxFeatureReporter #include "gfxEnv.h" // for gfxEnv #include "gfxPlatform.h" // for gfxPlatform #include "gfxPrefs.h" // for gfxPrefs @@ -225,8 +224,6 @@ CompositorOGL::CleanupResources() bool CompositorOGL::Initialize(nsCString* const out_failureReason) { - ScopedGfxFeatureReporter reporter("GL Layers"); - // Do not allow double initialization MOZ_ASSERT(mGLContext == nullptr, "Don't reinitialize CompositorOGL"); @@ -424,8 +421,6 @@ CompositorOGL::Initialize(nsCString* const out_failureReason) console->LogStringMessage(msg.get()); } - reporter.SetSuccessful(); - return true; } diff --git a/gfx/layers/opengl/TextureHostOGL.cpp b/gfx/layers/opengl/TextureHostOGL.cpp index 02c398b51..ec6ba9131 100644 --- a/gfx/layers/opengl/TextureHostOGL.cpp +++ b/gfx/layers/opengl/TextureHostOGL.cpp @@ -161,9 +161,7 @@ TextureImageTextureSourceOGL::Update(gfx::DataSourceSurface* aSurface, } } - mTexImage->UpdateFromDataSource(aSurface, aDestRegion, aSrcOffset); - - return true; + return mTexImage->UpdateFromDataSource(aSurface, aDestRegion, aSrcOffset); } void |