Commit Graph

1602 Commits

Author SHA1 Message Date
egdaniel
ed3af6648f Use Color Processor for color bitmap text draws on gpu.
This change is here since previously color bitmap text was rendered using a
geometry processor in the coverage stage. The problem with this is that we
cannot correctly do xfer modes with this method. So I now make color bitmap text
draw using a color stage in the same was as a draw bitmap call.

One issue that arrises from this fix is that we end up adding this final color
processor after any previous color processors. Thus if we have a custom blend
implemented as a color processor it will be before this text one and we won't
blend correctly. This issue will get fixed once an xfer processor is fully
implemented. I have hacked a test locally to show that if we can add the text
color processor to the begining of the color stages we do blend correctly in all
cases (so the xfer processor will be a fix).

BUG=skia:

Review URL: https://codereview.chromium.org/689923004
2014-10-31 06:55:45 -07:00
reed
f037e0bf13 allow SkUserConfig.h to control NOGPU
BUG=skia:

Review URL: https://codereview.chromium.org/685243002
2014-10-30 11:34:15 -07:00
bsalomon
f2703d83da rename GrTextureDesc->GrSurfaceDesc, GrTextureFlags->GrSurfaceFlags
Review URL: https://codereview.chromium.org/682223002
2014-10-28 14:33:06 -07:00
halcanary
dffa397f83 add gm: filterbitmap_image_color_wheel
BUG=skia:3061

TBR=mtklein@google.com

Review URL: https://codereview.chromium.org/633333004
2014-10-27 10:32:18 -07:00
humper
535e3b2025 Fix the way we patch up the matrix for scaled images that aren't
clamp/clamp

BUG=skia:2904
TBR=reed

Review URL: https://codereview.chromium.org/675823002
2014-10-27 10:32:07 -07:00
halcanary
30b83d45a3 add gm: colorwheel
BUG=skia:3061

Review URL: https://codereview.chromium.org/680533002
2014-10-26 05:23:53 -07:00
halcanary
f622a6c8fd Add SkIRect bounds() convenience method to SkImageInfo and SkBitmap.
Review URL: https://codereview.chromium.org/646213003
2014-10-24 12:54:53 -07:00
senorblanco
cbf6b6ecd5 Fix imagemagnifier GM quality and speed.
The imagemagnifier GM was applying the filter both to a saveLayer()
restore() around the whole scene, as well as to each individual
text draw.

Applying the filter only in the saveLayer() makes it run ~20x faster
on my Linux box, and the quality is improved as well (since the
primitives are not double-filtered).

BUG=skia:

Review URL: https://codereview.chromium.org/637283009
2014-10-23 15:00:12 -07:00
bsalomon
efd7d45fc0 Don't use MIP filter mode on compressed textures
Add compressed texture image downsample GMs

BUG=chromium:426331

Review URL: https://codereview.chromium.org/672863003
2014-10-23 14:17:46 -07:00
sugoi
234f036b3e Adding an option to render only the shadow in SkDropShadowImageFilter
This is basically how blink uses the filter. Currently, I can't use it for "ShadowOnly" mode with the filter at all, but instead of copying the code and risking to have the codepaths diverge, I'm simply going to add the option here.

BUG=skia:

Review URL: https://codereview.chromium.org/646213004
2014-10-23 13:59:52 -07:00
bungeman
c20386e393 Update fontMgr to take list of bcp47 language tags.
This will enable clients to pass more than one bcp47 tag to ensure
that the most appropriate font is selected.

BUG=chromium:422180

Review URL: https://codereview.chromium.org/670243002
2014-10-23 07:08:06 -07:00
reed
a0c814cffb Add SkTypeface::getBounds()
mirrored from https://codereview.chromium.org/666303002/

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/676523002
2014-10-22 13:20:58 -07:00
jvanverth
fca302ccf4 Add color emoji fallback for distance field text.
BUG=skia:3033

Review URL: https://codereview.chromium.org/670533002
2014-10-20 13:12:55 -07:00
tfarina
a5414c4a8e Turn SkCanvasStateUtils into a class with static functions.
That simplifies the way to declare it a friend, as needed in SkCanvas.

BUG=skia:2914
TEST=make most
R=reed@google.com

Review URL: https://codereview.chromium.org/645773002
2014-10-10 06:19:09 -07:00
caryclark
feff7d2d77 Draw more accurate thick-stroked Beziers (disabled)
Draw thick-stroked Beziers by computing the outset quadratic, measuring the error, and subdividing until the error is within a predetermined limit.

To try this CL out, change src/core/SkStroke.h:18 to

  #define QUAD_STROKE_APPROXIMATION 1

or from the command line: CPPFLAGS="-D QUAD_STROKE_APPROXIMATION=1" ./gyp_skia

Here's what's in this CL:

bench/BezierBench.cpp : a microbench for examining where the time is going
gm/beziers.cpp        : random Beziers with various thicknesses
gm/smallarc.cpp       : a distillation of bug skia:2769
samplecode/SampleRotateCircles.cpp : controls added for error, limit, width
src/core/SkStroke.cpp : the new stroke implementation (disabled)
tests/StrokerTest.cpp : a stroke torture test that checks normal and extreme values

The new stroke algorithm has a tweakable parameter:

  stroker.setError(1);  (SkStrokeRec.cpp:112)

The stroke error is the allowable gap between the midpoint of the stroke quadratic and the center Bezier. As the projection from the quadratic approaches the endpoints, the error is decreased proportionally so that it is always inside the quadratic curve.

An overview of how this works:
- For a given T range of a Bezier, compute the perpendiculars and find the points outset and inset for some radius.
- Construct tangents for the quadratic stroke.
- If the tangent don't intersect between them (may happen with cubics), subdivide.
- If the quadratic stroke end points are close (again, may happen with cubics), draw a line between them.
- Compute the quadratic formed by the intersecting tangents.
- If the midpoint of the quadratic is close to the midpoint of the Bezier perpendicular, return the quadratic.
- If the end of the stroke at the Bezier midpoint doesn't intersect the quad's bounds, subdivide.
- Find where the Bezier midpoint ray intersects the quadratic.
- If the intersection is too close to the quad's endpoints, subdivide.
- If the error is large proportional to the intersection's distance to the quad's endpoints, subdivide.

BUG=skia:723,skia:2769

Review URL: https://codereview.chromium.org/558163005
2014-10-09 05:36:04 -07:00
sugoi
ce686270f5 Adding 3D lut color filter
Included in this cl is support for 3D textures.

BUG=skia:

Review URL: https://codereview.chromium.org/580863004
2014-10-09 05:27:23 -07:00
bsalomon
bcf0a52d4f GrResourceCache2 manages scratch texture.
BUG=skia:2889

Review URL: https://codereview.chromium.org/608883003
2014-10-08 08:40:09 -07:00
bsalomon
b82b9d577e Make GM default to reseting gpu contexts on android.
TBR=mtklein@google.com

Committed: https://skia.googlesource.com/skia/+/8dd35ce178e4319685a870faf544a0b1d7aef5bb

Review URL: https://codereview.chromium.org/635293003
2014-10-08 08:17:11 -07:00
djsollen
901704b34e fix android framework build errors
Review URL: https://codereview.chromium.org/637953002
2014-10-08 07:12:11 -07:00
bsalomon
7663d66681 Revert of Make GM default to reseting gpu contexts on android. (patchset #1 id:1 of https://codereview.chromium.org/635293003/)
Reason for revert:
Crashing on Galaxy Nexus (probably tickled an existing skia or driver bug)

Original issue's description:
> Make GM default to reseting gpu contexts on android.
>
> TBR=mtklein@google.com
>
> Committed: https://skia.googlesource.com/skia/+/8dd35ce178e4319685a870faf544a0b1d7aef5bb

TBR=mtklein@google.com
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/639773003
2014-10-08 05:41:24 -07:00
bsalomon
8dd35ce178 Make GM default to reseting gpu contexts on android.
TBR=mtklein@google.com

Review URL: https://codereview.chromium.org/635293003
2014-10-08 04:20:56 -07:00
Brian Salomon
9323b8b8e1 Revert "GrResourceCache2 manages scratch texture."
This reverts commit d14e1a2764.
2014-10-07 15:07:38 -04:00
jvanverth
f9669f43bf Fix perspective version of dftext GM
Review URL: https://codereview.chromium.org/634923002
2014-10-07 07:59:46 -07:00
bsalomon
d14e1a2764 GrResourceCache2 manages scratch texture.
BUG=skia:2889

Review URL: https://codereview.chromium.org/608883003
2014-10-07 07:27:07 -07:00
jvanverth
ed14f1d9db Reduce sizes in dftext GM on Android to match desktop better.
Review URL: https://codereview.chromium.org/630103003
2014-10-06 12:50:54 -07:00
robertphillips
1564dde11a Fix multipicturedraw_biglayer GM
Having a layer is a prerequisite for having it be hoisted.

Review URL: https://codereview.chromium.org/632743002
2014-10-06 11:50:31 -07:00
robertphillips
7f1ed835e9 Reduce overdraw in MultiPictureDraw Sierpinski GM
As written, all the layers in the MPD Sierpinski GM are full screen. This CL bounds each layer to reduce overdraw.

This CL will cause differences in:

multipicturedraw_sierpinski_simple
multipicturedraw_sierpinski_tiled

but they are/will be suppressed in: (Don't turn on dither for saveLayers which have no paint - https://codereview.chromium.org/619363002/)

Review URL: https://codereview.chromium.org/582633003
2014-10-03 07:29:20 -07:00
robertphillips
b1fc64b8fa Add a MultiPictureDraw GM to exercise layer clipping
This adds a "biglayer" variant that creates a picture with a single big layer. The tiling composition will test whether the layer hoisting code correctly caches the layers with their clipping information.

BUG=skia:2315

Review URL: https://codereview.chromium.org/617723004
2014-10-02 08:32:43 -07:00
reed
4942e7550e fix prev change to tooBigForLCD, and add test
BUG=skia:

Review URL: https://codereview.chromium.org/617353003
2014-10-01 13:59:34 -07:00
mtklein
46616af01b Strip old backend recording down to essentials
Feature-wise, this removes:
  1) BBH support;
  2) peephole optimizations;
  3) record-time text op specializations;
  4) the guarantee that SkPaints are flattened.

This deletes the optimizations GM, which only exists to test the peepholes of
the old backend.  SkRecord optimizations are unit tested, and if that ever fails we
can think about adding another GM like this, but they're different enough we'd
want to start from scratch anyway.

We need to keep the code that plays back the specialized text ops around for
a while for compatibility with existing .SKPs that have those ops recorded.

BUG=skia:

CQ_EXTRA_TRYBOTS=tryserver.skia:Canary-Chrome-Ubuntu13.10-Ninja-x86_64-ToT-Trybot
R=robertphillips@google.com, reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/617953002
2014-09-30 14:47:10 -07:00
robertphillips
dbe6074a06 Revert of GrResourceCache2 manages scratch texture. (patchset #14 id:260001 of https://codereview.chromium.org/608883003/)
Reason for revert:
Turning bots red:
Nanobench seems to be uniformly failing on Android
(http://108.170.220.21:10117/builders/Perf-Android-Venue8-PowerVR-x86-Release/builds/99/steps/RunNanobench/logs/stdio)

Ubuntu GTX660 32bit is failing in both Debug and Release on GM generation (it appears to be out of memory) (http://108.170.220.120:10117/builders/Test-Ubuntu12-ShuttleA-GTX660-x86-Debug/builds/2457/steps/GenerateGMs/logs/stdio)

Original issue's description:
> GrResourceCache2 manages scratch texture.
>
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/3d398c876440deaab39bbf2a9b881c337e6dc8d4

R=bsalomon@google.com
TBR=bsalomon@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/611383003
2014-09-30 06:54:17 -07:00
bsalomon
3d398c8764 GrResourceCache2 manages scratch texture.
BUG=skia:
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/608883003
2014-09-30 06:02:23 -07:00
robertphillips
aa0c837667 Make pictures in multipicturedraw GM fit in 0,0..W,H range
Having the picture contents not actually reside in the 0,0..W,H range wrecks havoc with the layer hoisting. The hoisting works correctly but since the picture don't fulfill their contract the results look incorrect.

This CL just translates the picture's contents to the right so they are within the picture bound.

R=egdaniel@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/594363003
2014-09-29 05:07:39 -07:00
piotaixr
b5fae93d72 SkCanvas::drawImage is the new way for drawing a SkImage to a Canvas
BUG=skia:2947

Committed: https://skia.googlesource.com/skia/+/432789972c1e1f8a66165c75a250dba1853efa08

R=junov@chromium.org, reed@google.com, bsalomon@google.com

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/583453002
2014-09-24 13:03:30 -07:00
borenet
2456b7681a Revert of SkCanvas::drawImage is the new way for drawing an SkImage to a Canvas (patchset #9 id:160001 of https://codereview.chromium.org/583453002/)
Reason for revert:
Broke ChromiumOS Ozone builder: http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Ozone%20Builder/builds/4087/steps/compile/logs/stdio

Reverting to unblock DEPS roll.

Original issue's description:
> SkCanvas::drawImage is the new way for drawing a SkImage to a Canvas
>
> BUG=skia:2947
>
> Committed: https://skia.googlesource.com/skia/+/432789972c1e1f8a66165c75a250dba1853efa08

R=junov@chromium.org, reed@google.com, bsalomon@google.com, piotaixr@chromium.org
TBR=bsalomon@google.com, junov@chromium.org, piotaixr@chromium.org, reed@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2947

Author: borenet@google.com

Review URL: https://codereview.chromium.org/598133002
2014-09-24 11:03:35 -07:00
piotaixr
432789972c SkCanvas::drawImage is the new way for drawing a SkImage to a Canvas
BUG=skia:2947
R=junov@chromium.org, reed@google.com, bsalomon@google.com

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/583453002
2014-09-23 14:10:50 -07:00
joshualitt
b0a8a377f8 Patch to create a distinct geometry processor. The vast majority of this patch
is just a rename.  The meat is in GrGeometryProcessor, GrProcessor,
GrGL*Processor, GrProcessorStage, Gr*BackendProcessorFactory,
GrProcessUnitTestFactory, and the builders

BUG=skia:
R=bsalomon@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/582963002
2014-09-23 09:50:21 -07:00
jvanverth
76ce81e5e6 Fix SDF font positions when using global scale.
Also fixes a crash in the dftext GM when using SampleApp,
and adds new test case in dftext.

BUG=skia:2928
R=joshualitt@google.com, egdaniel@google.com

Author: jvanverth@google.com

Review URL: https://codereview.chromium.org/588223002
2014-09-22 14:26:53 -07:00
reed
4a8126e7f8 Introduce Props to surface (patchset #27 id:520001 of https://codereview.chromium.org/551463004/)"
This reverts commit 29c857d0f3.

TBR=

Author: reed@google.com

Review URL: https://codereview.chromium.org/588143004
2014-09-22 07:29:03 -07:00
reed
29c857d0f3 Revert of introduce Props to surface (patchset #27 id:520001 of https://codereview.chromium.org/551463004/)
Reason for revert:
Broke call site in WebKit

Original issue's description:
> introduce Props to surface (work in progress)
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/3716fd067a5621bb94a6cb08d72afec8bf3aceda

R=robertphillips@google.com, bsalomon@google.com, jvanverth@google.com, bungeman@google.com, fmalita@google.com, vangelis@chromium.org, reed@google.com
TBR=bsalomon@google.com, bungeman@google.com, fmalita@google.com, jvanverth@google.com, reed@google.com, robertphillips@google.com, vangelis@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/583773004
2014-09-21 10:25:07 -07:00
reed
3716fd067a introduce Props to surface (work in progress)
BUG=skia:
R=robertphillips@google.com, bsalomon@google.com, jvanverth@google.com, bungeman@google.com, fmalita@google.com, vangelis@chromium.org, reed@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/551463004
2014-09-21 09:39:55 -07:00
fmalita
8483326704 SkTextBlob shader space workaround.
Blink would like drawTextBlob(x,y) to behave the same as drawText(x,y)
WRT shader space. Due to the current generic device base impl, that is
not the case.

This is a transitional workaround, pending proper drawTextBlob impls
in SkDevice classes.

R=reed@google.com, robertphillips@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/586743002
2014-09-19 11:40:51 -07:00
robertphillips
ab79ab5aab Fix memory leak in MultiPictureDraw GM
R=fmalita@google.com, fmalita@chromium.org

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/585033002
2014-09-19 11:30:38 -07:00
robertphillips
3bc25e7247 Extend MultiPictureDraw GM
This new GM case is intended to exercise the matrix oriented aspects of layer caching.

R=jvanverth@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/582113004
2014-09-19 08:56:09 -07:00
reed
48925e3b31 check for failed file->data (fails on mac)
TBR=

Author: reed@google.com

Review URL: https://codereview.chromium.org/581263002
2014-09-18 13:57:05 -07:00
piotaixr
0d276f71d2 Bis: Use SkImage::NewFromGenerator() instead of SkImage::newEncodedData()
BUG=skia:2948
R=junov@chromium.org, reed@google.com

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/579923002
2014-09-18 11:55:14 -07:00
reed
e010f1c2a0 hide deviceproperties, prepare the way for surfaceprops
BUG=skia:
NOTRY=True
R=bungeman@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/577023002
2014-09-17 10:49:38 -07:00
fmalita
acb882c239 Ensure blob typeface information survives SkGPipe serialization.
When flattening text blobs to the temp buffer, we need to collect
typeface info and ship it across the pipe explicitly.

R=mtklein@google.com, reed@google.com, robertphillips@google.com, bungeman@google.com
BUG=412445

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/563783003
2014-09-16 17:58:34 -07:00
mtklein
e1daac9b26 Tag recording picture nesting bench as nonrendering.
Doesn't hurt as is, but we're running it several times unneccesarily.

(I couldn't compile without removing an unused constant in that other GM...)

BUG=skia:
R=fmalita@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/570303002
2014-09-16 10:12:42 -07:00
jvanverth
9564ce60a6 Fix scaling issue with distance field text.
Picks the correct distance field size based on both the text size and
the max matrix scale. Adjusts the matrix scale if non-unity. Also adds
GM for verifying proper distance field scaling.

BUG=skia:2928
R=bsalomon@google.com, joshualitt@google.com

Author: jvanverth@google.com

Review URL: https://codereview.chromium.org/568843002
2014-09-16 05:45:19 -07:00