mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
f38f996411
- bug 1249738 - make sWakeLockObservers a function static r=dhylands (a606893142) - bug 1249738 - make sSystemClockChangeObservers a function static r=dhylands (c994867638) - bug 1249738 - make sSystemTimezoneChangeObservers a function static r=dhylands (d053417e69) - Bug 1184285 - Stop warning if RemoveObserver() is called for unregistered observer. r=dhylands (5119547e11) - Bug 1244754 - part 1 - backport zero-length gradient interval fix from Skia upstream. r=jrmuizel (c1ae572de9) - Bug 1229975 - backport fix for Skia's GrConvexPolyEffect. r=mchang (80aba4e282) - Bug 1206961 - Use channel->AsyncOpen2() in image/imgLoader.cpp; removing security checks from the callsite reveals that we have to pass the accurate contentPolicyType to ValidateEntry (r=seth,bz) (0d771560b6) - Bug 1266615 - Fix C4334 in imgFrame.cpp. r=padenot (2d8227a6cc) - Bug 1230907 - mPixelRowSize added to constructor with 0 value. r=seth (5681184935) - Bug 1249550 (part 1) - Flip BMPs with negative height when downscaling. r=tn. (ca5978c766) - Bug 1249550 (part 2) - Add a test. r=tn. (d3c61944de) - Bug 1255675. SurfacePipe handles removing the frame rect, so pass the frame rect directly. (ef71f57a9a) - Bug 1255104 - Use SurfacePipe in nsIconDecoder. r=njn (e10c6c8a29) - Bug 1120141. Don't use surface with alpha for first frames of all pngs. r=edwin (5e5ffc4465) - Bug 1265631 - patch 1 - Add line-break data from Unicode's LineBreak.txt to nsUnicodeProperties for builds without ICU. r=masayuki (9873992421) - Bug 1265631 - patch 2 - Implement GetLineBreakClass() accessor to get Unicode line-break class from ICU or nsUnicodeProperties data. r=masayuki (fe7fcbf270) - Bug 1265631 - Reftests for line-breaking with supplementary-plane characters. r=masayuki (55e1974356) - Bug 1265631 - patch 3 - Add surrogate support to nsJISx4051LineBreaker so that supplementary-plane characters get correct line-breaking behavior. r=masayuki (ef24e8efc5) - Bug 1265631 - followup with adjustments for review comments on patch 3. no_r=me (4fbc8d5a98) - Bug 1128454 - Fix IPDL test (r=jimm) (82cb7e77fa) - Bug 1254373: Make TestDemon build on Windows; r=billm (11eeb63019) - Bug 1227327 - Use regular background image display items for painting button backgrounds. r=mattwoodrow (7a36d30032) - Bug 1255022 - Make the test_transformed_scrolling_repaints* tests mochitest-plain instead of mochitest-chrome. r=mstange (3d150690e7) - Bug 1268195 - When restoring a scroll position outside of incremental load, don't keep trying in a loop - just do it once and stop. r=tnikkel (ab9f4f57ab) - Bug 1265256 - Use the canvas positioning area when computing the background-attachment:fixed rect for canvas frames. r=mstange (3dda1b8beb) - Bug 623432 part 1 - When the target scroll point is at the screen edge and no scrolling occured, then try to scroll 10px in that direction anyway. r=tn (f9952f107d) - Bug 623432 part 2 - Ignore scrollbars while drag-selecting content. r=tn (ca26f1145e) - Bug 623432 part 3 - Check nsFrameSelection::GetDragState() earlier to optimize away some more expensive calls. r=tn (6d540874e2) - Bug 1269539 - Ensure that the scroll position is restored properly on reloading a page which loads incrementally. r=tnikkel (1e018dca29) - Bug 1239808 - Fix mozharness mach command for test_packages.json retrieval. r=jlund (9639ec1459) - Bug 1248097, part 1 - Fix indentation in SpecialPowersObserver.jsm. r=jmaher (75ed8bf7b9) - Bug 1248097, part 2 - If no name is specified for createFiles, use createUnique to create one. r=jmaher (aa9b8b60f7) - Bug 1248097, part 3 - Add file creation support for options. r=jmaher (9086ae5f9c) - Bug 1248097, part 4 - Don't throw away the _createdFiles array every time. r=jmaher (4a7732a4d4) - Bug 1241576 - Convert testing/ to use channel.open2() (r=sicking) (ecadf38f7b) - Bug 1251139 - Support running a function in the parent with loadChromeScript. r=jmaher (50377424bb) - Bug 1153128 - Add sendSyncMessage to SpecialPowers.loadChromeScript. =jmaher (f53c487b0c) - bug 1254091 convert test_mousecapture.xul to mochitest-plain so we can run it in e10s, r=enndeakin (900bce80cf) - Bug 1254091 - part 2: fix focus messaging from SpecialPowers to refer to the right window, r=enndeakin (4ec66a9b8f) - Bug 1258534 - Port test_bug599295.html to mochitest-plain so that it can be turned on in e10s mode; r=mrbkap (2a669777de) - Bug 1260076 - [Mochitest] implement SpecialPowers.loadPrivilegedScript, r=bholley (8e2076f952) - Bug 1252750 - Part 1: Create a helper function on SpecialPowersAPI which creates a nested event queue and spins it for a bit. r=mrbkap (fdefa1a3d6) - Bug 1205358 - Fix up nsUrlClassifierPrefixSet memory reporting. r=gcp. (1c9d78607d) - Bug 1244259 - Limit PrefixSet read and write buffer sizes to file size. r=froydnj (0906574833) - Bug 1247615 - Fix off-by-one error in PrefixSet Delta storage compaction. r=froydnj (b72f052289) - Bug 1219482: Replace PRLogModuleInfo with LazyLogModule in toolkit subdirectory.r=erahm (9d00df5d13) - Bug 1213400 - Fix crash in broken Safe Browsing list updates. r=gcp (a073ec1a8f) - Bug 1160263: Don't allow add-ons to override the periodic XPI signature check. r=rstrong (1ef54384cc) - Bug 1180273 - Adding missing 'this' pointer when forwarding newChannel2 calls (r=gijs,sicking) (b173efdff4) - Bug 1147562 - Update remaining callsites of newChannel before landing the shim in b2g/ (r=sicking) (10ab6df542) - Bug 1194087 - MailtoProtocolHandler, SmsProtocolHandler, and TelProtocolHandler will all fire twice after introduction of newChannel2 r=asuth (ff7cc15c67) - Bug 1204703 - Add AsyncOpen2 to channels in toolkit/ and b2g/ (r=sicking) (8d4b8ad5c6) - Bug 1264383 - makeFilteringListener breaks eventremoval with shims. r=mconley (6a9d6d5079) - Bug 1256468 - sessionHistory shim should QI DocShell to nsIWebNavigation automatically. r=krizsa (9a111454cb) - Bug 1164011 - Test for CPOW shims. r=mconley (bbf7880955) - Bug 1236409 - Remove toolkit impl of XUL prompt for nsICookiePromptService r=margaret (9f620ba65a) - Bug 1236259 - Quote MOZ_APP_ID; r=gps (58b8e287b8) - Bug 1174036 - Handle dynamically-removed textareas gracefully. r=mikedeboer r=ehsan (0797d45e3b) - Bug 1259531 - [e10s] Fix test_bug451286.xul to run in e10s by converting to a mochitest-browser test. r=mikedeboer (00539d564c) - Bug 1237798 - Use correct Components object inside CommonJS. r=Yoric (895beb28e2) - Bug 1188158 - Move nsIPrivateBrowsingTrackingProtectionWhitelist to its own component in toolkit; r=jdm (6c75ab641b) - Bug 1221537 - Provide a flash.bat script for Windows to device image builds (especially aries). r=fabrice (3eb8a25c0a) - Bug 1232285 - The Terminator's notion of ticks is incorrect. r=Yoric (bc2688343c) - Bug 1252382 - Get rid of PR_Sleep in the terminator;r=froydnj (a76de950df) - Bug 1242084 - nsTerminator::UpdateTelemetry() leaks 8 byte nsStringBuffer when app.update.channel gets set to Beta. r=gfritzsche (56902dc11b) - align some tests (e5179f8158) - Bug 1260908 - Allow keyed histograms to accumulate early in startup (r=gfritzsche) (1852efe810) - Bug 1254550 - Make Telemetry configuration consistent across builds. r=gfritzsche (16dcbf9a83)
137 lines
3.7 KiB
C++
137 lines
3.7 KiB
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#include "nsIconDecoder.h"
|
|
#include "RasterImage.h"
|
|
#include "SurfacePipeFactory.h"
|
|
|
|
using namespace mozilla::gfx;
|
|
|
|
namespace mozilla {
|
|
namespace image {
|
|
|
|
static const uint32_t ICON_HEADER_SIZE = 2;
|
|
|
|
nsIconDecoder::nsIconDecoder(RasterImage* aImage)
|
|
: Decoder(aImage)
|
|
, mLexer(Transition::To(State::HEADER, ICON_HEADER_SIZE))
|
|
, mBytesPerRow() // set by ReadHeader()
|
|
{
|
|
// Nothing to do
|
|
}
|
|
|
|
nsIconDecoder::~nsIconDecoder()
|
|
{ }
|
|
|
|
void
|
|
nsIconDecoder::WriteInternal(const char* aBuffer, uint32_t aCount)
|
|
{
|
|
MOZ_ASSERT(!HasError(), "Shouldn't call WriteInternal after error!");
|
|
MOZ_ASSERT(aBuffer);
|
|
MOZ_ASSERT(aCount > 0);
|
|
|
|
Maybe<TerminalState> terminalState =
|
|
mLexer.Lex(aBuffer, aCount, [=](State aState,
|
|
const char* aData, size_t aLength) {
|
|
switch (aState) {
|
|
case State::HEADER:
|
|
return ReadHeader(aData);
|
|
case State::ROW_OF_PIXELS:
|
|
return ReadRowOfPixels(aData, aLength);
|
|
case State::FINISH:
|
|
return Finish();
|
|
default:
|
|
MOZ_CRASH("Unknown State");
|
|
}
|
|
});
|
|
|
|
if (terminalState == Some(TerminalState::FAILURE)) {
|
|
PostDataError();
|
|
}
|
|
}
|
|
|
|
LexerTransition<nsIconDecoder::State>
|
|
nsIconDecoder::ReadHeader(const char* aData)
|
|
{
|
|
// Grab the width and height.
|
|
uint8_t width = uint8_t(aData[0]);
|
|
uint8_t height = uint8_t(aData[1]);
|
|
|
|
// The input is 32bpp, so we expect 4 bytes of data per pixel.
|
|
mBytesPerRow = width * 4;
|
|
|
|
// Post our size to the superclass.
|
|
PostSize(width, height);
|
|
|
|
// Icons have alpha.
|
|
PostHasTransparency();
|
|
|
|
// If we're doing a metadata decode, we're done.
|
|
if (IsMetadataDecode()) {
|
|
return Transition::TerminateSuccess();
|
|
}
|
|
|
|
MOZ_ASSERT(!mImageData, "Already have a buffer allocated?");
|
|
IntSize targetSize = mDownscaler ? mDownscaler->TargetSize() : GetSize();
|
|
IntRect targetFrameRect(IntPoint(0, 0), targetSize);
|
|
|
|
Maybe<SurfacePipe> pipe =
|
|
SurfacePipeFactory::CreateSurfacePipe(this, 0, GetSize(), targetSize,
|
|
targetFrameRect, SurfaceFormat::B8G8R8A8,
|
|
SurfacePipeFlags());
|
|
if (!pipe) {
|
|
return Transition::TerminateFailure();
|
|
}
|
|
|
|
mPipe = Move(*pipe);
|
|
|
|
MOZ_ASSERT(mImageData, "Should have a buffer now");
|
|
|
|
return Transition::To(State::ROW_OF_PIXELS, mBytesPerRow);
|
|
}
|
|
|
|
LexerTransition<nsIconDecoder::State>
|
|
nsIconDecoder::ReadRowOfPixels(const char* aData, size_t aLength)
|
|
{
|
|
MOZ_ASSERT(aLength % 4 == 0, "Rows should contain a multiple of four bytes");
|
|
|
|
auto result = mPipe.WritePixels<uint32_t>([&]() -> NextPixel<uint32_t> {
|
|
if (aLength == 0) {
|
|
return AsVariant(WriteState::NEED_MORE_DATA); // Done with this row.
|
|
}
|
|
|
|
uint32_t pixel = *reinterpret_cast<const uint32_t*>(aData);
|
|
aData += 4;
|
|
aLength -= 4;
|
|
|
|
return AsVariant(pixel);
|
|
});
|
|
|
|
MOZ_ASSERT(result != WriteState::FAILURE);
|
|
|
|
Maybe<SurfaceInvalidRect> invalidRect = mPipe.TakeInvalidRect();
|
|
if (invalidRect) {
|
|
PostInvalidation(invalidRect->mInputSpaceRect,
|
|
Some(invalidRect->mOutputSpaceRect));
|
|
}
|
|
|
|
return result == WriteState::FINISHED
|
|
? Transition::To(State::FINISH, 0)
|
|
: Transition::To(State::ROW_OF_PIXELS, mBytesPerRow);
|
|
}
|
|
|
|
LexerTransition<nsIconDecoder::State>
|
|
nsIconDecoder::Finish()
|
|
{
|
|
PostFrameStop();
|
|
PostDecodeDone();
|
|
|
|
return Transition::TerminateSuccess();
|
|
}
|
|
|
|
} // namespace image
|
|
} // namespace mozilla
|