Граф коммитов

55 Коммитов

Автор SHA1 Сообщение Дата
cku 09c56e6da6 Bug 1323912 - Part 2. Pass opacity down to imgIContainer::Draw. r=mstange
Each concrete class of imgIContainer is able to handle opacity already. All we
need to do is pass opacity value to them.

MozReview-Commit-ID: EMkLnG3YXA1

--HG--
extra : rebase_source : b0a0aad1fec0c2765e96d23ed9b627345c793795
2017-01-03 13:53:22 +08:00
Iris Hsiao c8e876e89c Backed out changeset c868ab532766 (bug 1323912) 2017-01-04 21:47:12 -05:00
cku adab9bea9f Bug 1323912 - Part 2. Pass opacity down to imgIContainer::Draw. r=mstange
Each concrete class of imgIContainer is able to handle opacity already. All we
need to do is pass opacity value to them.

MozReview-Commit-ID: EMkLnG3YXA1

--HG--
extra : rebase_source : 080a843b34cc1ca27831310d474243b4066f59f2
2017-01-03 13:53:22 +08:00
Andrew Osmond 0eb070a4cc Bug 1311779 - Part 2. Add telemetry to track optimizable opaque images decoded into B8G8R8A8 surfaces. r=tnikkel 2016-10-19 12:34:30 -04:00
Nathan Froyd 19607c3802 Bug 1306625 - fix wonky identation in imgFrame.cpp; r=tnikkel
DONTBUILD because whitespace-only fixes are always safe...right?
2016-09-30 23:11:59 -04:00
Bas Schouten 77e2a32f4a Bug 1296657: Attempt to create an mOptSurface of the correct type for the DT we're drawing to. r=tnikkel
MozReview-Commit-ID: 2LIQWUPAuaF
2016-09-15 13:53:12 +02:00
Seth Fowler 2977081713 Bug 1296147 (Part 2) - Rename imgFrame::GetSurface() to imgFrame::GetSourceSurface() for clarity. r=edwin 2016-08-18 13:03:49 -07:00
Seth Fowler 7a29534fe8 Bug 1293794 - Allow imgFrame volatile buffers to be freed on all platforms. r=jrmuizel 2016-08-15 17:42:30 -07:00
Ryan Hunt 92206266e3 Bug 1294586 - Remove dependency on gfxPlatform from CreateDrawTargetFromData. r=dvander
MozReview-Commit-ID: A355fBJKWP6

--HG--
extra : rebase_source : 85ffd4b9d5f9708a1666bbc8e229ba576cc97680
2016-08-11 14:54:08 -07:00
Nicholas Nethercote e7f10a07fd Bug 1293603 (part 2) - Make Run() declarations consistent. r=erahm.
This patch makes most Run() declarations in subclasses of nsIRunnable have the
same form: |NS_IMETHOD Run() override|.

As a result of these changes, I had to add |override| to a couple of other
functions to satisfy clang's -Winconsistent-missing-override warning.

--HG--
extra : rebase_source : 815d0018b0b13329bb5698c410f500dddcc3ee12
2016-08-08 12:18:10 +10:00
Seth Fowler ba8bb5de9d Bug 1292747 (Part 3) - Clean up some comments in imgFrame related to Optimize()'s behavior. r=edwin 2016-08-08 16:25:50 -07:00
Seth Fowler ad2f26e773 Bug 1292747 (Part 2) - Remove the 565 optimization from imgFrame. r=edwin 2016-08-08 16:25:48 -07:00
Seth Fowler 55d13bdddf Bug 1292747 (Part 1) - Remove 565 optimization telemetry. r=edwin 2016-08-08 16:25:46 -07:00
Seth Fowler f09a1b3d95 Bug 1290682 (Part 2) - Clean up imgFrame::Draw() and related code now that we know no non-trivial frame rects will occur. r=edwin 2016-08-01 17:51:18 -07:00
Seth Fowler 94cd474a67 Bug 1290682 (Part 1) - Explicitly forbid non-trivial frame rects in imgFrame::Draw() except for paletted frames. r=edwin 2016-08-01 17:51:16 -07:00
Seth Fowler e36fc95869 Bug 1290681 (Part 2) - Remove the single color optimization from imgFrame. r=edwin 2016-08-01 17:51:13 -07:00
Seth Fowler b704f1ab3d Bug 1290681 (Part 1) - Remove telemetry for the single color optimization. r=edwin 2016-08-01 17:51:11 -07:00
Seth Fowler 78ccdc2e84 Bug 1288040 (Part 5) - Wrap frame timeout values in a FrameTimeout type that ensures they're normalized. r=edwin 2016-07-20 16:30:28 -07:00
Mason Chang 02f263e5b9 Bug 1282496 - memset unoptimized images with RGBX surface format to 0xFF. r=seth 2016-06-30 18:59:29 -07:00
Daniel Holbert c1e322c6c5 Bug 1282670, part 1: Add missing #include & "using" declarations in imagelib. r=seth
I found these issues locally by moving all of imagelib's .cpp files to SOURCES instead of UNIFIED_SOURCES.  (That change isn't part of this patch, though.)

MozReview-Commit-ID: 97Xpfu8eFE6
2016-06-30 10:24:27 -07:00
Phil Ringnalda 10f146a52a Back out 269a48e67579 (bug 1282496) for Windows gfx crashes and assertion failures
CLOSED TREE
2016-06-27 19:13:12 -07:00
Mason Chang dbf96fa749 Bug 1282496 - memset unoptimized images with RGBX surface format to 0xFF when using the skia backend. r=seth 2016-06-27 17:45:55 -07:00
Seth Fowler 5bb4252ff6 Bug 1281680 - Add telemetry for image optimizations that may no longer be useful. r=edwin 2016-06-25 15:41:16 -07:00
Seth Fowler 17074a1b49 Bug 1255107 (Part 3) - Use SurfacePipe in the PNG decoder. r=njn 2016-06-25 14:04:05 -07:00
Julian Seward 5b033cd6c7 Bug 1278927 - TSan: data race image/imgFrame.cpp on hasCheckedOptimize. r=seth. 2016-06-20 15:46:00 +02:00
Nicholas Nethercote a02611e830 Bug 1276824 (part 1) - Rename gfxContext::ForDrawTarget{,WithTransform}(). r=milan.
The new names Create{,PreservingTransform}OrNull() better communicate that
these functions (a) do object creation, and (b) are fallible.

--HG--
extra : rebase_source : a36bd9a2bcdfae281868959403f811f2bc690ad4
2016-06-07 09:39:56 +10:00
Jonathan Watt 2eb705bb3f Bug 1277862, part 3 - Rename Moz2D's Filter to SamplingFilter in the rest of the tree. r=Bas 2016-05-25 17:01:18 +01:00
Seth Fowler cf4a581f11 Bug 1276413 (Part 1) - Clear paletted image frames when they're allocated. r=edwin 2016-06-01 11:59:47 -07:00
Seth Fowler b2e7bf31dc Bug 1059026 - Replace imgFrame::mOffset and imgFrame::mSize with imgFrame::mFrameRect. r=edwin 2016-05-26 22:19:38 -07:00
Seth Fowler 20e94cffd8 Bug 1275750 (Part 3) - Remove imgFrame::GetFormat(). r=edwin
--HG--
extra : rebase_source : 013843b9eb385723237a45843cddd443c6d20af0
2016-05-26 11:33:38 -07:00
Seth Fowler 943f760d93 Bug 1275750 (Part 2) - Remove unused GetDrawTarget()-related code. r=edwin
--HG--
extra : rebase_source : 22fa2ba0046f544bddaf68af14d2c4c3448386e9
2016-05-26 11:33:38 -07:00
Seth Fowler 7bb45773cb Bug 1275750 (Part 1) - Remove unused ScalingData-related code. r=edwin
--HG--
extra : rebase_source : 4f32b5244dad988f845fd6371cfe13389e44eb81
2016-05-26 11:33:38 -07:00
JerryShih 325dfdc8dd Bug 1256572 - use SourceSurfaceRawData with custom deallocator in imgFrame. r=bas
We can prevent the memory copy in GuaranteePersistance() during painting.
2016-05-05 07:30:00 +02:00
Kyle Huey c73656947b Bug 1265927: Move nsRunnable to mozilla::Runnable, CancelableRunnable to mozilla::CancelableRunnable. r=froydnj 2016-04-25 17:23:21 -07:00
Xidorn Quan 8080406d39 Bug 1266615 - Fix C4334 in imgFrame.cpp. r=padenot
MozReview-Commit-ID: BYBRJoFBj0V

--HG--
extra : rebase_source : 72ae050a2c167f1112947c3df5d9afed97e3226d
2016-04-22 11:22:53 +10:00
Milan Sreckovic e0b2b9e425 Bug 1259513: Make gfxContext constructor private, use a utility function that can return nullptr. r=bas,lsalzman
MozReview-Commit-ID: rHhLEDZEQt

--HG--
extra : rebase_source : 4988f3f488c19dd35a9979e96f78a5511ee8f3d2
2016-04-12 15:18:11 -04:00
Timothy Nikkel b0b9bfd047 Bug 1222596. If RasterImage::LookupFrame does (some) sync decoding and encouters an error we don't want to return the surface with an error. r=seth
If the sync decoding the LookupFrame does encounters an error it will set mError on the RasterImage, which LookupFrame callers check before calling LookupFrame. But they've called LookupFrame before the error was encountered, so we check if the frame has had Abort called on it to determine if we should return it at all.

We only does this if one of the sync decode flags was passed in because IsAborted needs to get the imgFrame's monitor, so we don't want to block consumers that haven't asked for decoding.
2016-04-01 12:44:17 -05:00
Timothy Nikkel 5afe8e5453 Bug 1257101. imgFrame::IsImageComplete says whether we've had pixels decoded to the whole image rect, but it's used to check if the frame is finished decoding. These are different things when the image has more than one progress pass. r=seth
This means that in RasterImage::LookupFrame when we are asked to do a sync decode (if needed) we use WaitUntilComplete to wait until the frame is finished decoding.  But we would actually return after the next progressive pass notified the monitor to wake up. Thus, we would draw a not-fully-decoded image even though the sync decode flag was passed.

The change in FrameAnimator means that we won't draw the next frame in an animated image until all progressive passes of that image are complete. This seems like what we want anyways.

There is one real use of IsImageComplete left, in imgFrame::Draw, where we need to know if the decoded image data covers the whole image frame. (There are a couple of uses of IsImageComplete in asserts.)
2016-03-23 19:31:42 -05:00
Seth Fowler 875464424a Bug 1247152 (Part 1) - Use SurfacePipe in the GIF decoder. r=njn 2016-03-09 15:39:02 -08:00
Mason Chang e74c79f0e3 Bug 1221840. Support repeating images in 1 axis. r=seth 2015-11-23 08:17:35 -08:00
Nicholas Nethercote 489c83b1dd Bug 1223690 - Remove implicit Rect conversions. r=jrmuizel.
gfxRect can be implicitly constructed from IntRect, which hides a number of
implicit conversion points, makes Moz2Dification harder, and has some
surprising effects.

This patch removes the implicit constructor and replaces it with an explicit
conversion function:

  gfxRect ThebesRect(const IntRect&)

This is the obvious outcome of removing the constructor.

But there is also a second, less obvious outcome: currently we do a number of
IntRect-to-Rect conversions using ToRect(), which (surprisingly) works because
it turns into an implicit IntRect-to-gfxRect conversion (via the implicit
constructor) combined with an explicit gfxRect-to-Rect conversion (via
ToRect()). I.e. we do two conversions, going from a Moz2D type to a Thebes
type and back to a Moz2D type!

So this patch also changes these conversion. It moves this existing function:

  Rect ToRect(const IntRect&)

from gfx2DGlue.h -- where it doesn't really belong because it doesn't involve
any Thebes types -- to gfx/2d/Rect.h, templatifying and renaming it as
IntRectToRect() in the process.

The rest of the patch deals with fall-out from these changes. The call sites
change as follows:

- IntRect-to-gfxRect conversions:
  - old: implicit
  - new: ThebesRect()

- IntRect-to-Rect conversions:
  - old: ToRect()
  - new: IntRectToRect()

--HG--
extra : rebase_source : e4e4c2ad10b36ecad4d57d1630158f3374e403be
2015-11-11 14:23:14 -08:00
Nicholas Nethercote a34d272e2b Bug 1209812 (part 3) - Rename SurfaceFormat::R5G6B5 as R5G6B5_UINT16. r=Bas.
--HG--
extra : rebase_source : 1efcfb2522e823e55b5c7b77531a9d2c42c49c8b
2015-10-22 23:01:31 -07:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Nathan Froyd 583afa0965 Bug 1207245 - part 3 - switch all uses of mozilla::RefPtr<T> to nsRefPtr<T>; r=ehsan
This commit was generated using the following script, executed at the
top level of a typical source code checkout.

 # Don't modify select files in mfbt/ because it's not worth trying to
 # tease out the dependencies currently.
 #
 # Don't modify anything in media/gmp-clearkey/0.1/ because those files
 # use their own RefPtr, defined in their own RefCounted.h.
find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    grep -v 'mfbt/RefPtr.h' | \
    grep -v 'mfbt/nsRefPtr.h' | \
    grep -v 'mfbt/RefCounted.h' | \
    grep -v 'media/gmp-clearkey/0.1/' | \
    xargs perl -p -i -e '
 s/mozilla::RefPtr/nsRefPtr/g; # handle declarations in headers
 s/\bRefPtr</nsRefPtr</g; # handle local variables in functions
 s#mozilla/RefPtr.h#mozilla/nsRefPtr.h#; # handle #includes
 s#mfbt/RefPtr.h#mfbt/nsRefPtr.h#;       # handle strange #includes
'

 # |using mozilla::RefPtr;| is OK; |using nsRefPtr;| is invalid syntax.
find . -name '*.cpp' -o -name '*.mm' | xargs sed -i -e '/using nsRefPtr/d'

 # RefPtr.h used |byRef| for dealing with COM-style outparams.
 # nsRefPtr.h uses |getter_AddRefs|.
 # Fixup that mismatch.
find . -name '*.cpp' -o -name '*.h'| \
    xargs perl -p -i -e 's/byRef/getter_AddRefs/g'
2015-10-18 00:40:10 -04:00
Nicholas Nethercote 0f5722f4da Bug 1211324 (part 5) - Remove GraphicsFilter and gfxGraphicsFilter. r=mattwoodrow. 2015-10-05 17:18:10 -07:00
Nicholas Nethercote 342466f878 Bug 1208345 - Remove gfxContext::GraphicsOperator. r=jwatt.
Also...

- Rename various "operator" identifiers as "op" to match |CompositionOp|.

- Rename |nsBackgroundLayerState::mCompositingOp| as |mCompositionOp| to match
  |CompositionOp|.

- Remove some deprecated functions that are no longer needed.

--HG--
extra : rebase_source : 74e9b6eecf6f442e27cc18fd4ae6f668a45188aa
2015-09-24 22:38:58 -07:00
Nicholas Nethercote 842dd1cf5a Bug 1207741 - Remove gfxIntSize. r=nical.
gfxIntSize is just a typedef of gfx::IntSize, so this is very mechanical. The
only tricky part is deciding for each occurrence whether to replace it with
IntSize, gfx::IntSize or mozilla::gfx::IntSize; in all cases I went with the
shortest one that worked given the existing "using namespace" declarations.

--HG--
extra : rebase_source : 67fd15f87222b16defa70ef795c6d77dfacf1c36
2015-09-23 11:49:05 -07:00
Seth Fowler b060891f89 Bug 1146663 (Part 3) - Make it impossible to deoptimize imgFrames. r=tn 2015-09-19 16:21:02 -07:00
Seth Fowler 3fdb290471 Bug 1187386 (Part 4) - Make imgFrame::SetOptimizable() callable from off-main-thread. r=tn
--HG--
extra : rebase_source : 726f0b66275f80acd655720a2aa684fb18d9016f
2015-07-31 07:29:10 -07:00
Nicholas Nethercote 31ef869796 Bug 1188705 (part 3) - Simplify imgFrame::SizeOfExcludingThis(). r=seth.
imgFrame::SizeOfExcludingThis() measures heap and non-heap memory in a very
complex way. This patch simplifies it and removes gfxMemoryLocation in the
process. (gfxMemoryLocation::OUT_OF_PROCESS was unused.)

--HG--
extra : rebase_source : 72af38fa438b4b42df02231bcf2fa731d247b60d
2015-07-28 21:02:45 -07:00