Commit Graph
116 Commits
Author SHA1 Message Date
Kartikaya Gupta 7c1da03e1c Bug 1403915 - Remove the WebRender*Layer classes and functions that refer to them. r=jrmuizel
MozReview-Commit-ID: 2syFwMc7j3r
2017-10-03 16:31:08 -04:00
cku c6c67990e7 Bug 1373750 - Part 1. Except the bottom layer, recompute clip state of each mask layer by a clear clipState object. r=mstange
In nsCSSRendering::PaintStyleImageLayerWithSC, we reuse the same clip-state
object,  clipState, for all bg/mask layers. We hit this assertion if the
border-radius of previous one is not 0, but the the border-radius of the next
one is 0. In this condition, clipState.mHasRoundedCorners is false, but
clipState.mClippedRadii still stores border-radius information of the previous
layer.

MozReview-Commit-ID: KyxD0vPnMb9
2017-09-25 15:07:45 +08:00
Ethan Lin 1558c1e290 Bug 1352453 - Check image dimension when computing border space size. r=heycam
MozReview-Commit-ID: LQcf9UGyUUq
2017-09-23 15:06:07 +08:00
Alexis Beingessner 4c657ebe03 Bug 1400382 - Replace explicit TextDrawTarget passing with cast-based system. r=mstange
MozReview-Commit-ID: EQtFvLQCT2U
2017-09-21 15:15:58 -04:00
Sebastian Hengst 50a28edc06 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: mr7OYuaLKE
2017-09-21 15:23:43 +02:00
Morris Tseng d7ade017fc Bug 1392200 - Add backface-visibility support for layers-free mode. r=kats
For layers-full mode, we set the backface-visibility to visible because
visibility would be handled by FLB and layers.

MozReview-Commit-ID: CUbeUabfC7K
2017-09-21 14:41:38 +08:00
Nicolas Silva 3c8f9ba825 Bug 1393031 - Remove unused nsTArray<WebRenderParentCommand>& parameter all over the place. r=jrmuizel 2017-09-20 13:36:53 +02:00
Nicolas Silva 32380e2bcc Bug 1393031 - Use IpcResourceUpdateQueue in more places. r=jrmuizel 2017-09-20 10:56:20 +02:00
Jonathan Watt 7428c44f4d Bug 1401356, part 1 - Rename nsSVGEffects.h/.cpp to SVGObserverUtils.h/.cpp. r=longsonr 2017-08-30 14:14:46 +01:00
Ya-Chieh Wu b83408d729 Bug 895096 - Part 3: Clean up twipsPerPixel to oneDevPixel. r=dbaron
MozReview-Commit-ID: 70aRd6KFpdd
2017-09-12 19:49:00 -04:00
Ya-Chieh Wu ce7e82d6e3 Bug 895096 - Part 2: Merge the identical parameters. r=dbaron
MozReview-Commit-ID: DNXagFqxLsq
2017-09-12 19:49:00 -04:00
Ya-Chieh Wu 75dce64b3a Bug 895096 - Part 1: Round border-collapsed table borders to device pixels rather than CSS pixels, as for other borders, and store them (as BCPixelSize) as device pixels rather than CSS pixels. r=dbaron
MozReview-Commit-ID: 3yqj8gAAGYv
2017-09-12 19:48:00 -04:00
Xidorn Quan 45b9f27e27 Bug 1400438 - Use array instead of linked list for -moz-border-*-colors. r=heycam,mattwoodrow
MozReview-Commit-ID: LPl1Rlg5gRn
2017-09-18 13:38:39 +10:00
Kartikaya Gupta 0779a96def Bug 1395218 - Make the bevel side parameters more strongly-typed. r=dholbert
MozReview-Commit-ID: 5rymg5uTMC1
2017-08-30 12:22:18 -04:00
Alexis Beingessner 17c2751eec Bug 1357545 - handle text-shadows/decorations with webrender (layers-free) r=jrmuizel
This replaces our DrawTargetCapture hack with a similar but more powerful TextDrawTarget
hack. The old design had several limitations:

* It couldn't handle shadows
* It couldn't handle selections
* It couldn't handle font/color changes in a single text-run
* It couldn't handle decorations (underline, overline, line-through)

Mostly this was a consequence of the fact that it only modified the start and end
of the rendering algorithm, and therefore couldn't distinguish draw calls for different
parts of the text.

This new design is based on a similar principle as DrawTargetCapture, but also passes
down the TextDrawTarget in the drawing arguments, so that the drawing algorithm can
notify us of changes in phase (e.g. "now we're doing underlines"). This also lets us
directly pass data to TextDrawTarget when possible (as is done for shadows and selections).

In doing this, I also improved the logic copied from ContainsOnlyColoredGlyphs to handle
changes in font/color mid-text-run (which can happen because of font fallback).

The end result is:

* We handle all shadows natively
* We handle all selections natively
* We handle all decorations natively
* We handle font/color changes in a single text-run
    * Although we still hackily intercept draw calls
    * But we don't need to buffer commands, reducing total memcopies

In addition, this change integrates webrender's PushTextShadow and PushLine APIs,
which were designed for this use case. This is only done in the layerless path;
WebrenderTextLayer continues to be semantically limited, as we aren't actively
maintaining non-layers-free webrender anymore.

This also doesn't modify TextLayers, to minimize churn. In theory they can be
augmented to support the richer semantics that TextDrawTarget has, but there's
little motivation since the API is largely unused with this change.

MozReview-Commit-ID: 4IjTsSW335h
2017-06-19 10:58:28 -04:00
Ya-Chieh Wu 30e89ce362 Bug 1375518 - Fix border-radius on table row groups, rows, column groups, or columns. r=dbaron
Before bug 929484, border-radius on row groups, rows, column groups,
or columns don't apply to the background of each cell, yet the
border-radius on the cell itself does. After bug 929484, the behaviors
changed. In this patch, I tried to revert the behaviors of border-radius
on table row groups, rows, column groups, or columns back to
what happened before bug 929484.

MozReview-Commit-ID: 1Xg1qHde3lk
2017-07-14 15:50:04 +08:00
Carsten "Tomcat" Book 80abf444f0 merge mozilla-inbound to mozilla-central a=merge 2017-07-25 14:27:17 +02:00
Wes Kocher c6d00f73af Merge m-c to autoland, a=merge
MozReview-Commit-ID: B7oWq7qfpJ0
2017-07-24 18:13:05 -07:00
cku 71b46184ed Bug 1382257 - (followup) Draw border image if nsCSSBorderImageRenderer was created successfully. r=me.
MozReview-Commit-ID: 7SJwCt9XUBF
2017-07-24 13:27:54 +08:00
Mason Chang dc86d1dd59 Bug 1365876. Blur text shadows on the CPU. r=lsalzman 2017-07-24 13:48:14 -07:00
cku 8d6dca6025 Bug 1382257 - Correct returning value of PaintBorderWithStyleBorder. r=mstange
We overwrites DrawResult returning from
nsCSSBorderImageRenderer::CreateBorderImageRenderer by the returning value of
DrawBorderImage, which is not right.

MozReview-Commit-ID: 1EeqU5hLyln
2017-07-21 09:50:36 +08:00
Michael Scott 32783bc54c Bug 1383395 - Remove an un-needed check for draw background image. r=cjku
Remove the the duplicate check for draw background image is false, in the PaintStyleImageLayerWithSC method,
as this is already covered by the preceding code.

MozReview-Commit-ID: L669Y4OjzE0
2017-07-23 12:58:58 +03:00
Kartikaya Gupta b8b3120020 Bug 1377169 - Turn gfxRect into a typedef. r=jrmuizel
One thing to note here is that the Scale function on gfxRect has a
different implementation than that in gfx::Rect which is replacing it.
The former just scales the width/height directly whereas the latter
scales the XMost/YMost and recomputes the width/height.

MozReview-Commit-ID: 5FImdIaNfC3
2017-07-05 11:22:00 -04:00
Kartikaya Gupta 793d78e155 Bug 1377090 - Turn gfxMatrix into a typedef for MatrixDouble. r=jrmuizel
Most of this patch is updating a few places that use gfxMatrix to use
the equivalent-but-differently-named functions on MatrixDouble:
- Translate/Rotate/Scale get turned into PreTranslate/PreRotate/PreScale
- Transform(Point) gets turned into TransformPoint(Point)
- gfxMatrix::TransformBounds(gfxRect) gets turned into
  gfxRect::TransformBoundsBy(gfxMatrix).
- gfxMatrix::Transform(gfxRect) gets turned into
  gfxRect::TransformBy(gfxMatrix).
The last two functions are added in this patch as convenience wrappers
to gfxRect instead of Matrix.h because we don't want Matrix.h to "know"
about gfxRect (to avoid adding gecko dependencies on Moz2D). Once we
turn gfxRect into a typedef for RectDouble these will be eliminated
anyway.

MozReview-Commit-ID: BnOjHzmOSKn
2017-07-05 11:18:49 -04:00
Morris Tseng cece2e5b5d Bug 1376855 - Support nsDisplayBackgroundImage in layers free mode. r=kats
MozReview-Commit-ID: KaIAVfNB4E5
2017-06-28 15:07:45 -07:00
Nicholas Nethercote a58025002f Bug 1375392 - Tweak the PROFILER_LABEL* macros. r=mstange.
This patch makes the following changes to the macros.

- Removes PROFILER_LABEL_FUNC. It's only suitable for use in functions outside
  classes, due to PROFILER_FUNCTION_NAME not getting class names, and it was
  mostly misused.

- Removes PROFILER_FUNCTION_NAME. It's no longer used, and __func__ is
  universally available now anyway.

- Combines the first two string literal arguments of PROFILER_LABEL and
  PROFILER_LABEL_DYNAMIC into a single argument. There was no good reason for
  them to be separate, and it forced a '::' in the label, which isn't always
  appropriate. Also, the meaning of the "name_space" argument was interpreted
  in an interesting variety of ways.

- Adds an "AUTO_" prefix to PROFILER_LABEL and PROFILER_LABEL_DYNAMIC, to make
  it clearer they construct RAII objects rather than just being function calls.
  (I myself have screwed up the scoping because of this in the past.)

- Fills in the 'js::ProfileEntry::Category::' qualifier within the macro, so
  the caller doesn't need to. This makes a *lot* more of the uses fit onto a
  single line.

The patch also makes the following changes to the macro uses (beyond those
required by the changes described above).

- Fixes a bunch of labels that had gotten out of sync with the name of the
  class and/or function that encloses them.

- Removes a useless PROFILER_LABEL use within a trivial scope in
  EventStateManager::DispatchMouseOrPointerEvent(). It clearly wasn't serving
  any useful purpose. It also serves as extra evidence that the AUTO_ prefix is
  a good idea.

- Tweaks DecodePool::SyncRunIf{Preferred,Possible} so that the labelling is
  done within them, instead of at their callsites, because that's a more
  standard way of doing things.
2017-06-22 17:08:53 +10:00
Andi-Bogdan Postelnicu 2f097a2e51 Bug 1373232 - Use floating point division when dividing nscoord values with a twipsPerPixel factor. r=mats
MozReview-Commit-ID: JR3EDkDuwVA
2017-06-18 09:33:25 +03:00
Alexis Beingessner 3117218f13 Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel
MozReview-Commit-ID: K1WUIOnvazF
2017-06-13 11:00:10 -04:00
Sebastian Hengst 1b1d14e565 Backed out changeset 3d1ce85e6348 (bug 1088760) for bustage, at least on Android at layout/generic/nsPluginFrame.cpp:1612. r=backout 2017-06-13 00:30:03 +02:00
Alexis Beingessner c6fbc5e17e Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel
MozReview-Commit-ID: K1WUIOnvazF
2017-06-12 17:32:48 -04:00
Jeff Hajewski e7886588bb Bug 1371354: Changes macro defined NS_SYTLE_IMAGELAYER_ to enum class StyleImageLayer; r=manishearth
MozReview-Commit-ID: DgvenevRHg2
2017-06-09 16:53:34 -07:00
L. David Baron 03d37750a7 Bug 1369260 - Remove use of MOZ_ASSERT_IF in layout. r=heycam
As I've said before, as module owner I prefer that MOZ_ASSERT_IF not be
used in the module because I consider it to be unreadable.  However, a
few uses have crept in, and this patch removes them.

I consider it to be unreadable because the name looks like a name that
uses smalltalk-ish naming conventions, i.e., with a part of the name
corresponding to each parameter, in order.  However, the parameters are
in the order opposite the name.

This was written primarily with the vim commands:
:%s/MOZ_ASSERT_IF(\([^,]*\),/MOZ_ASSERT(!\1 ||/
:wn
followed by manual cleanup for indentation and removal of !!.

MozReview-Commit-ID: G6rLbOn7k8d
2017-06-06 22:27:17 -07:00
Ethan Lin 5976144b97 Bug 1366984 - Fix image container check for background image layer. r=mattwoodrow 2017-05-31 14:01:28 +08:00
Ryan VanderMeulen 24638f9059 Backed out changeset 14a2665a64f6 (bug 1366984) for causing Windows Talos failures on a CLOSED TREE. 2017-05-31 13:03:41 -04:00
Ethan Lin 61f32f9d64 Bug 1366984 - Fix image container check for background image layer. r=mattwoodrow 2017-05-31 14:01:28 +08:00
Jonathan Kew 4dcf0fe444 Bug 1365982 - Attach frame properties to each frame instead of looking them up in a hashtable on the prescontext. r=mats 2017-05-27 12:36:00 +01:00
Mats Palmgren bd90393cc1 Bug 1365614 part 3 - Backout bug 1333482 part 1-9. Removes support for [-webkit-]appearance for now b/c web compat issues. r=bz
MozReview-Commit-ID: IbwWM0FL6HF
2017-05-21 17:15:00 +08:00
Carsten "Tomcat" Book 1aa86b3e0e Backed out changeset bbb688fe1ba3 (bug 1365614) 2017-05-22 15:45:31 +02:00
Mats Palmgren 473a358067 Bug 1365614 part 3 - Backout bug 1333482 part 1-9. Removes support for [-webkit-]appearance for now b/c web compat issues. r=bz 2017-05-21 17:15:00 +08:00
Ethan Lin f77c13de63 Bug 1364830 - Fix background image layer's draw result and image flags. r=mattwoodrow 2017-05-16 10:44:49 +08:00
cku 0beb51be12 Bug 1361180 - Part 1. Return error DrawResult to the caller when the mask url can not be resolved. r=mstange
Precondition:
In an SVG doc, giving an invalid local-ref mask, e.g. mask="url"#foo"", and
clipState.mDirtyRectInDevPx be empty. e.g. apply mask onto a path object which
the size of area is zero(Please refers to the reftest in Part 2)
1. PaintStyleImageLayerWithSC early continue at [1], and the value of result is
still the initial value, DrawResult::SUCCESS.
2. The caller is not aware of that the  mask image was left unresolved since it get
DrawResult::SUCCESS from #1.

This patch fixed this problem by calling PrepareImageLayer before early return
for updating correct drawing result.

[1]
https://hg.mozilla.org/mozilla-central/file/ebf68ba9b098/layout/painting/nsCSSRendering.cpp#l2682

MozReview-Commit-ID: DjJ0Nni1gDl
2017-05-03 10:39:05 +08:00
Kartikaya Gupta 30355f64ab Merge m-c to graphics
MozReview-Commit-ID: DVUE3Wys3HV
2017-05-03 08:52:43 -04:00
Kartikaya Gupta bb8dee32df Bug 1360246 - Propagate the StackingContextHelper to the rest of the displaylist-building code. r=nical
This propagates the StackingContextHelper to the rest of the code that
builds WR display items, because we will need it in future patches to
stop using RelativeToParent.

MozReview-Commit-ID: 3PlQrJRhH36
2017-05-03 08:48:08 -04:00
Ethan Lin e78c57ff45 Bug 1360127 - If the background image doesn't have a image container, we shouldn't create a layer for it. r=mchang 2017-05-03 18:27:10 +08:00
Emilio Cobos Álvarez 643f3f8618 Bug 1361051: rename mozilla::FrameType to mozilla::LayoutFrameType. r=xidorn
This avoids conflicts with mozilla::dom::FrameType.

MozReview-Commit-ID: 7aEMbHRaTFk
2017-05-01 19:32:52 +02:00
Emilio Cobos Álvarez 3731858edf Bug 1360241: Devirtualize nsIFrame::GetType. r=heycam
MozReview-Commit-ID: 5Nzhyta5Hle
2017-04-30 17:30:08 +02:00
Wes Kocher 05341df9bd Merge autoland to central, a=merge
MozReview-Commit-ID: 2pgVZdnDKno
2017-04-27 12:44:03 -07:00
Ethan Lin c4d20e93ee Bug 1359360 - Handle draw result for webrender background image layer. r=mattwoodrow 2017-04-26 15:31:49 +08:00
Ethan Lin c3bd8aa1bc Bug 1351242 - Add webrender support for nsDisplayBackgroundImage image type. r=mchang 2017-04-07 14:53:16 +08:00
cku 222c45e4de Bug 1359844 - Ensure full decode be triggered after style-image was downloaded, r=mstange
In nsCSSRendering::PaintBorderWithStyleBorder:
DrawResult
nsCSSRendering::PaintBorderWithStyleBorder()
{
  if (aStyleBorder.IsBorderImageLoaded()) {
    (1)
  }

  (2)
}

At (1), we create a nsCSSBorderImageRenderer object. While creating it, we call
imgRenderer.PrepareImage() to ensure a full image decode at [1]. PrepareImage is
used in both bg-image/mask-image and border-image. The difference is, in
bg-image/mask-image painting path, we unconditionally use PrepareImage(in
nsCSSRendering::PrepareImageLayer), whereas in border-image painting path we
use it only after border-image was downloaded. This difference does cause a
problem. After border image was downloaded, the decoder will not do full decoding
since we did not ask for it, so there will be no repaint notification and no
chance to paint border-image again.

In this patch, I try to align the behavior between bg-image/mask-image and
border-image: always call nsImageRenderer::PrepareImage.

This is a generic fix for both stylo-enable and stylo-disable build. We do not
find this problem in reftest is because we use SYNC_DECODE in reftest harness, which
hides this race condition. When daily using firefox, if
nsCSSRendering::PaintBorderWithStyleBorder is called after border-image was
loaded, your program run into (1), border-image will be drawn correctly; In the
case that nsCSSRendering::PaintBorderWithStyleBorder is called before
border-image is loaded, your program run into (2), and you can only see
border-color.

[1]
https://hg.mozilla.org/mozilla-central/file/a6f35285bd1e/layout/painting/nsCSSRenderingBorders.cpp#l3598

MozReview-Commit-ID: 6pidHJdPG8I
2017-04-17 15:10:52 +08:00