head 1.3; access; symbols pkgsrc-2015Q1:1.1.0.2 pkgsrc-2015Q1-base:1.1; locks; strict; comment @// @; 1.3 date 2015.05.12.22.48.54; author ryoon; state dead; branches; next 1.2; commitid NJZg0HQjg2n73dly; 1.2 date 2015.04.05.12.54.11; author ryoon; state Exp; branches; next 1.1; commitid K8Tn7QcmAk8VWogy; 1.1 date 2015.03.20.10.13.57; author martin; state Exp; branches; next ; commitid 9QDvXAr0lXKMzkey; desc @@ 1.3 log @Update to 38.0 Changelog: New New tab-based preferences New Ruby annotation support New Base for the next ESR release. Changed autocomplete=off is no longer supported for username/password fields Changed URL parser avoids doing percent encoding when setting the Fragment part of the URL, and percent decoding when getting the Fragment in line with the URL spec Changed RegExp.prototype.source now returns "(?:)" instead of the empty string for empty regular expressions Changed Improved page load times via speculative connection warmup HTML5 WebSocket now available in Web Workers HTML5 BroadcastChannel API implemented HTML5 Implemented srcset attribute and element for responsive images HTML5 Implemented DOM3 Events KeyboardEvent.code HTML5 Mac OS X: Implemented a subset of the Media Source Extensions (MSE) API to allow native HTML5 playback on YouTube HTML5 Implemented Encrypted Media Extensions (EME) API to support encrypted HTML5 video/audio playback (Windows Vista or later only) HTML5 Automatically download Adobe Primetime Content Decryption Module (CDM) for DRM playback through EME (Windows Vista or later only) Developer Optimized-out variables are now visible in Debugger UI Developer XMLHttpRequest logs in the web console are now visually labelled and can be filtered separately from regular network requests Developer WebRTC now has multistream and renegotiation support Developer copy command added to console Fixed Various security fixes Fixed in Firefox 38 2015-58 Mozilla Windows updater can be run outside of application directory 2015-57 Privilege escalation through IPC channel messages 2015-56 Untrusted site hosting trusted page can intercept webchannel responses 2015-55 Buffer overflow and out-of-bounds read while parsing MP4 video metadata 2015-54 Buffer overflow when parsing compressed XML 2015-53 Use-after-free due to Media Decoder Thread creation during shutdown 2015-52 Sensitive URL encoded information written to Android logcat 2015-51 Use-after-free during text processing with vertical text enabled 2015-50 Out-of-bounds read and write in asm.js validation 2015-49 Referrer policy ignored when links opened by middle-click and context menu 2015-48 Buffer overflow with SVG content and CSS 2015-47 Buffer overflow parsing H.264 video with Linux Gstreamer 2015-46 Miscellaneous memory safety hazards (rv:38.0 / rv:31.7) @ text @$NetBSD: patch-gfx_layers_basic_BasicLayerManager.cpp,v 1.2 2015/04/05 12:54:11 ryoon Exp $ Part of the patch in https://bugzilla.mozilla.org/show_bug.cgi?id=1105087 (sligthly modified to fix a compile error: PixmanTransform -> DrawTransform) diff --git a/gfx/layers/basic/BasicLayerManager.cpp b/gfx/layers/basic/BasicLayerManager.cpp --- gfx/layers/basic/BasicLayerManager.cpp.orig 2015-03-27 02:20:33.000000000 +0000 +++ gfx/layers/basic/BasicLayerManager.cpp @@@@ -46,8 +46,13 @@@@ #include "nsRect.h" // for nsIntRect #include "nsRegion.h" // for nsIntRegion, etc #include "nsTArray.h" // for nsAutoTArray +#if MOZ_ENABLE_SKIA #include "skia/SkCanvas.h" // for SkCanvas #include "skia/SkBitmapDevice.h" // for SkBitmapDevice +#else +#define PIXMAN_DONT_DEFINE_STDINT +#include "pixman.h" // for pixman_f_transform, etc +#endif class nsIWidget; namespace mozilla { @@@@ -606,6 +611,7 @@@@ BasicLayerManager::SetRoot(Layer* aLayer mRoot = aLayer; } +#if MOZ_ENABLE_SKIA static SkMatrix BasicLayerManager_Matrix3DToSkia(const gfx3DMatrix& aMatrix) { @@@@ -624,7 +630,7 @@@@ BasicLayerManager_Matrix3DToSkia(const g } static void -SkiaTransform(const gfxImageSurface* aDest, +DrawTransform(const gfxImageSurface* aDest, RefPtr aSrc, const gfx3DMatrix& aTransform, gfxPoint aDestOffset) @@@@ -663,6 +669,79 @@@@ SkiaTransform(const gfxImageSurface* aDe SkRect destRect = SkRect::MakeXYWH(0, 0, srcSize.width, srcSize.height); destCanvas.drawBitmapRectToRect(src, nullptr, destRect, &paint); } +#else +// See bugs 1097776 and 1105087. +static pixman_transform +BasicLayerManager_Matrix3DToPixman(const gfx3DMatrix& aMatrix) +{ + pixman_f_transform transform; + + transform.m[0][0] = aMatrix._11; + transform.m[0][1] = aMatrix._21; + transform.m[0][2] = aMatrix._41; + transform.m[1][0] = aMatrix._12; + transform.m[1][1] = aMatrix._22; + transform.m[1][2] = aMatrix._42; + transform.m[2][0] = aMatrix._14; + transform.m[2][1] = aMatrix._24; + transform.m[2][2] = aMatrix._44; + + pixman_transform result; + pixman_transform_from_pixman_f_transform(&result, &transform); + + return result; +} + +static void +DrawTransform(const gfxImageSurface* aDest, + RefPtr aSrc, + const gfx3DMatrix& aTransform, + gfxPoint aDestOffset) +{ + IntSize destSize = ToIntSize(aDest->GetSize()); + pixman_image_t* dest = pixman_image_create_bits(aDest->Format() == gfxImageFormat::ARGB32 ? PIXMAN_a8r8g8b8 : PIXMAN_x8r8g8b8, + destSize.width, + destSize.height, + (uint32_t*)aDest->Data(), + aDest->Stride()); + + IntSize srcSize = aSrc->GetSize(); + pixman_image_t* src = pixman_image_create_bits(aSrc->GetFormat() == SurfaceFormat::B8G8R8A8 ? PIXMAN_a8r8g8b8 : PIXMAN_x8r8g8b8, + srcSize.width, + srcSize.height, + (uint32_t*)aSrc->GetData(), + aSrc->Stride()); + + NS_ABORT_IF_FALSE(src && dest, "Failed to create pixman images?"); + + pixman_transform pixTransform = BasicLayerManager_Matrix3DToPixman(aTransform); + pixman_transform pixTransformInverted; + + // If the transform is singular then nothing would be drawn anyway, return here + if (!pixman_transform_invert(&pixTransformInverted, &pixTransform)) { + pixman_image_unref(dest); + pixman_image_unref(src); + return; + } + pixman_image_set_transform(src, &pixTransformInverted); + + pixman_image_composite32(PIXMAN_OP_SRC, + src, + nullptr, + dest, + aDestOffset.x, + aDestOffset.y, + 0, + 0, + 0, + 0, + destSize.width, + destSize.height); + + pixman_image_unref(dest); + pixman_image_unref(src); +} +#endif /** * Transform a surface using a gfx3DMatrix and blit to the destination if @@@@ -704,7 +783,7 @@@@ Transform3D(RefPtr aSourc gfx3DMatrix translation = gfx3DMatrix::Translation(aBounds.x, aBounds.y, 0); // Transform the content and offset it such that the content begins at the origin. - SkiaTransform(destImage, aSource->GetDataSurface(), translation * aTransform, offset); + DrawTransform(destImage, aSource->GetDataSurface(), translation * aTransform, offset); // If we haven't actually drawn to aDest then return our temporary image so // that the caller can do this. @ 1.2 log @Update to 37.0 * Bump nspr requirement. Changelog: New Heartbeat user rating system - your feedback about Firefox New Yandex set as default search provider for the Turkish locale New Bing search now uses HTTPS for secure searching New Improved protection against site impersonation via OneCRL centralized certificate revocation New Opportunistically encrypt HTTP traffic where the server supports HTTP/2 AltSvc Changed Disabled insecure TLS version fallback for site security Changed Extended SSL error reporting for reporting non-certificate errors Changed TLS False Start optimization now requires a cipher suite using AEAD construction Changed Improved certificate and TLS communication security by removing support for DSA Changed Improved performance of WebGL rendering on Windows HTML5 Implemented a subset of the Media Source Extensions (MSE) API to allow native HTML5 playback on YouTube (Windows only) HTML5 Added support for CSS display:contents HTML5 IndexedDB now accessible from worker threads HTML5 New SDP/JSEP implementation in WebRTC Developer Debug tabs opened in Chrome Desktop, Chrome for Android, and Safari for iOS Developer New Inspector animations panel to control element animations Developer New Security Panel included in Network Panel Developer Debugger panel support for chrome:// and about:// URIs Developer Added logging of weak ciphers to the web console Fixed Various security fixes Fixed in Firefox 37 2015-42 Windows can retain access to privileged content on navigation to unprivileged pages 2015-41 PRNG weakness allows for DNS poisoning on Android 2015-40 Same-origin bypass through anchor navigation 2015-39 Use-after-free due to type confusion flaws 2015-38 Memory corruption crashes in Off Main Thread Compositing 2015-37 CORS requests should not follow 30x redirections after preflight 2015-36 Incorrect memory management for simple-type arrays in WebRTC 2015-35 Cursor clickjacking with flash and images 2015-34 Out of bounds read in QCMS library 2015-33 resource:// documents can load privileged pages 2015-32 Add-on lightweight theme installation approval bypassed through MITM attack 2015-31 Use-after-free when using the Fluendo MP3 GStreamer plugin 2015-30 Miscellaneous memory safety hazards (rv:37.0 / rv:31.6) @ text @d1 1 a1 1 $NetBSD: patch-gfx_layers_basic_BasicLayerManager.cpp,v 1.1 2015/03/20 10:13:57 martin Exp $ @ 1.1 log @Make it build & work on sparc64 again @ text @d1 1 a1 1 $NetBSD$ d7 1 a7 1 --- gfx/layers/basic/BasicLayerManager.cpp.orig d9 1 a9 6 @@@@ -41,18 +41,23 @@@@ #include "nsAutoPtr.h" // for nsRefPtr #include "nsCOMPtr.h" // for already_AddRefed #include "nsDebug.h" // for NS_ASSERTION, etc #include "nsISupportsImpl.h" // for gfxContext::Release, etc #include "nsPoint.h" // for nsIntPoint d23 1 a23 11 namespace layers { using namespace mozilla::gfx; /** @@@@ -596,16 +601,17 @@@@ void BasicLayerManager::SetRoot(Layer* aLayer) { NS_ASSERTION(aLayer, "Root can't be null"); NS_ASSERTION(aLayer->Manager() == this, "Wrong manager"); NS_ASSERTION(InConstruction(), "Only allowed in construction phase"); d31 1 a31 11 SkMatrix transform; transform.setAll(aMatrix._11, aMatrix._21, aMatrix._41, aMatrix._12, @@@@ -614,17 +620,17 @@@@ BasicLayerManager_Matrix3DToSkia(const g aMatrix._14, aMatrix._24, aMatrix._44); return transform; d40 1 a40 11 { if (aTransform.IsSingular()) { return; } @@@@ -653,16 +659,89 @@@@ SkiaTransform(const gfxImageSurface* aDe SkPaint paint; paint.setXfermodeMode(SkXfermode::kSrc_Mode); paint.setAntiAlias(true); paint.setFilterLevel(SkPaint::kLow_FilterLevel); d120 1 a120 11 * it is efficient to do so. * * @@param aSource Source surface. * @@param aDest Desintation context. * @@param aBounds Area represented by aSource. @@@@ -694,17 +773,17 @@@@ Transform3D(RefPtr aSourc aDestRect.height), gfxImageFormat::ARGB32); gfxPoint offset = aDestRect.TopLeft(); // Include a translation to the correct origin. a128 5 return destImage.forget(); } void BasicLayerManager::PaintSelfOrChildren(PaintLayerContext& aPaintContext, @