Commit Graph

7752 Commits

Author SHA1 Message Date
Brian Salomon
39631f3df1 Add Atlas Text interface for rendering SDF glyphs.
This new API is built upon SDF text atlas code from the GPU backend. Unlike using the GPU
backend to draw text, this set of interfaces allows the client to render the SDF glyphs. The
client issues text draws to potentially multiple targets and then the client flushes. The
client then gets commands from Skia with data to put into a texture atlas and vertices to
draw that reference the texture. The client is responsible for creating the texture, uploading
the SDF data to the texture, and drawing the vertices provided by Skia.

Change-Id: Ie9447e19b85f0ce1c2b942e5216c787a74f335d3
Reviewed-on: https://skia-review.googlesource.com/59360
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-11-17 20:35:06 +00:00
Brian Osman
b092cea5b1 Revert "Revert "Revert "Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half"""""
This reverts commit 68ab18611a.

Reason for revert: Command Buffer bot

Original change's description:
> Revert "Revert "Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half""""
> 
> This reverts commit 3b2f5b60ff.
> 
> Reason for revert: more attempts at a fixed version
> 
> Original change's description:
> > Revert "Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half"""
> >
> > This reverts commit b5fb7cf016.
> >
> > Reason for revert: breaking more devices
> >
> > Original change's description:
> > > Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half""
> > >
> > > This reverts commit 0fb6db4be6.
> > >
> > > Reason for revert: fixed bug
> > >
> > > Original change's description:
> > > > Revert "Add private grpixelconfigs for alpha_8 and alpha_half"
> > > >
> > > > This reverts commit 33d17cbb00.
> > > >
> > > > Reason for revert: broke intel bots
> > > >
> > > > Original change's description:
> > > > > Add private grpixelconfigs for alpha_8 and alpha_half
> > > > >
> > > > > Bug: skia:
> > > > > Change-Id: I5191b6e045aea2a5af2b305b5972ad1e638a7ace
> > > > > Reviewed-on: https://skia-review.googlesource.com/71763
> > > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > > >
> > > > TBR=egdaniel@google.com,bsalomon@google.com
> > > >
> > > > Change-Id: I6fff9241f7878f1ec7fad2663df9922c9cd8f628
> > > > No-Presubmit: true
> > > > No-Tree-Checks: true
> > > > No-Try: true
> > > > Bug: skia:
> > > > Reviewed-on: https://skia-review.googlesource.com/72180
> > > > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > >
> > > TBR=egdaniel@google.com,bsalomon@google.com
> > >
> > > Change-Id: Ie028961ecbf5934c53cb859e019e548935b3af79
> > > Reviewed-on: https://skia-review.googlesource.com/72241
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > > Reviewed-by: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com
> >
> > Change-Id: Ieaac3eca2fc4919699c7de61a3c33348e92a7da0
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/72660
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com
> 
> Change-Id: Ifcf1b97c2a9493ce9a77a8aa0f4e5a8fb393def3
> Reviewed-on: https://skia-review.googlesource.com/72802
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: Ie2277f59f5a1294392b5d153ce2429c20b3e4182
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/73320
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-11-17 19:15:07 +00:00
Greg Daniel
68ab18611a Revert "Revert "Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half""""
This reverts commit 3b2f5b60ff.

Reason for revert: more attempts at a fixed version

Original change's description:
> Revert "Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half"""
>
> This reverts commit b5fb7cf016.
>
> Reason for revert: breaking more devices
>
> Original change's description:
> > Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half""
> >
> > This reverts commit 0fb6db4be6.
> >
> > Reason for revert: fixed bug
> >
> > Original change's description:
> > > Revert "Add private grpixelconfigs for alpha_8 and alpha_half"
> > >
> > > This reverts commit 33d17cbb00.
> > >
> > > Reason for revert: broke intel bots
> > >
> > > Original change's description:
> > > > Add private grpixelconfigs for alpha_8 and alpha_half
> > > >
> > > > Bug: skia:
> > > > Change-Id: I5191b6e045aea2a5af2b305b5972ad1e638a7ace
> > > > Reviewed-on: https://skia-review.googlesource.com/71763
> > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > >
> > > TBR=egdaniel@google.com,bsalomon@google.com
> > >
> > > Change-Id: I6fff9241f7878f1ec7fad2663df9922c9cd8f628
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: skia:
> > > Reviewed-on: https://skia-review.googlesource.com/72180
> > > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com
> >
> > Change-Id: Ie028961ecbf5934c53cb859e019e548935b3af79
> > Reviewed-on: https://skia-review.googlesource.com/72241
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com
>
> Change-Id: Ieaac3eca2fc4919699c7de61a3c33348e92a7da0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/72660
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: Ifcf1b97c2a9493ce9a77a8aa0f4e5a8fb393def3
Reviewed-on: https://skia-review.googlesource.com/72802
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-11-17 18:50:46 +00:00
Robert Phillips
57e0828fad Add backend GPU objects to fiddle app
TBR=bsalomon@google.com
Change-Id: I8876a4657f837436322150925233e0f36c91e8f0
Reviewed-on: https://skia-review.googlesource.com/72641
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2017-11-17 12:53:55 +00:00
Chris Dalton
584a79a1d5 Reland "Fold analytic clip FPs into GrReducedClip"
This is a reland of 4355b26b35
Original change's description:
> Fold analytic clip FPs into GrReducedClip
>
> Perf result on Pixel phone (sorted by impact):
>
>   GEOMEAN                              7.44 -> 6.92 ms   [ 93%]
>
>   keymobi_cnn_com.skp                  3.55 -> 3.59 ms   [101%]
>   keymobi_theverge_com.skp             4.08 -> 4.13 ms   [101%]
>   desk_skbug6850autoscroll.skp         1.21 -> 1.22 ms   [101%]
>   ...
>   top25desk_weather_com.skp            14.2 -> 11.5 ms   [ 81%]
>   keymobi_androidpolice_com_2012_.skp  3.84 -> 2.95 ms   [ 77%]
>   keymobi_shop_mobileweb_ebay_com.skp  2.94 -> 2.26 ms   [ 77%]
>   keymobi_boingboing_net.skp           3.08 -> 2.24 ms   [ 73%]
>   desk_jsfiddlebigcar.skp              1.90 -> 1.25 ms   [ 66%]
>   keymobi_m_youtube_com_watch_v_9.skp  13.5 -> 8.84 ms   [ 65%]
>   keymobi_sfgate_com_.skp              8.55 -> 5.55 ms   [ 65%]
>   keymobi_blogger.skp                  4.01 -> 2.60 ms   [ 65%]
>
> Cleaner code, improved skps, slightly better geometric mean time.
>
> Pixel C is mostly unaffected, presumably because it uses window
> rectangles.
>
> Bug: skia:7190
> Change-Id: Ia93f68b2f971ea66b3ab19dc73557ea602932a92
> Reviewed-on: https://skia-review.googlesource.com/67424
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com

Bug: skia:7190
Change-Id: I92f1ed21b6292feb3209fcbd1725487784d420da
Reviewed-on: https://skia-review.googlesource.com/72562
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-11-16 19:32:55 +00:00
Chris Dalton
47c8ed3c06 Reland "Fix precision caps and rrect/ellipse effect precisions"
This is a reland of e421800227
Original change's description:
> Fix precision caps and rrect/ellipse effect precisions
>
> Replaces all the complex precision caps with a single flag that says
> whether "float" == fp32. Updates the ellipse and rrect effects to
> use float coords, and use the scale workaround when float != fp32.
>
> Bug: skia:7190
> Change-Id: Ieccff9f38acd05e5cec78fe90d01a5da901a9307
> Reviewed-on: https://skia-review.googlesource.com/70961
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com

Bug: skia:7190
Change-Id: I7ced37a64164b83d86f6a957c35e10ce9085aba0
Reviewed-on: https://skia-review.googlesource.com/72760
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-11-16 19:29:56 +00:00
Greg Daniel
3b2f5b60ff Revert "Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half"""
This reverts commit b5fb7cf016.

Reason for revert: breaking more devices

Original change's description:
> Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half""
> 
> This reverts commit 0fb6db4be6.
> 
> Reason for revert: fixed bug
> 
> Original change's description:
> > Revert "Add private grpixelconfigs for alpha_8 and alpha_half"
> >
> > This reverts commit 33d17cbb00.
> >
> > Reason for revert: broke intel bots
> >
> > Original change's description:
> > > Add private grpixelconfigs for alpha_8 and alpha_half
> > >
> > > Bug: skia:
> > > Change-Id: I5191b6e045aea2a5af2b305b5972ad1e638a7ace
> > > Reviewed-on: https://skia-review.googlesource.com/71763
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com
> >
> > Change-Id: I6fff9241f7878f1ec7fad2663df9922c9cd8f628
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:
> > Reviewed-on: https://skia-review.googlesource.com/72180
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com
> 
> Change-Id: Ie028961ecbf5934c53cb859e019e548935b3af79
> Reviewed-on: https://skia-review.googlesource.com/72241
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: Ieaac3eca2fc4919699c7de61a3c33348e92a7da0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/72660
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-11-16 17:59:33 +00:00
Greg Daniel
b5fb7cf016 Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half""
This reverts commit 0fb6db4be6.

Reason for revert: fixed bug

Original change's description:
> Revert "Add private grpixelconfigs for alpha_8 and alpha_half"
>
> This reverts commit 33d17cbb00.
>
> Reason for revert: broke intel bots
>
> Original change's description:
> > Add private grpixelconfigs for alpha_8 and alpha_half
> >
> > Bug: skia:
> > Change-Id: I5191b6e045aea2a5af2b305b5972ad1e638a7ace
> > Reviewed-on: https://skia-review.googlesource.com/71763
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com
>
> Change-Id: I6fff9241f7878f1ec7fad2663df9922c9cd8f628
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/72180
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: Ie028961ecbf5934c53cb859e019e548935b3af79
Reviewed-on: https://skia-review.googlesource.com/72241
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-11-16 17:37:12 +00:00
Mike Reed
47f6029d3d remove legacy Create from SkTextBlob
Bug: skia:
Change-Id: I8814ac9fb6bf75b5113bd78e140adadde57d3898
Reviewed-on: https://skia-review.googlesource.com/72121
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-11-16 16:30:52 +00:00
Brian Osman
24f9c19172 Revert "Fix precision caps and rrect/ellipse effect precisions"
This reverts commit e421800227.

Reason for revert: Also may be responsible for layout test failures? Playing it safe.

Original change's description:
> Fix precision caps and rrect/ellipse effect precisions
> 
> Replaces all the complex precision caps with a single flag that says
> whether "float" == fp32. Updates the ellipse and rrect effects to
> use float coords, and use the scale workaround when float != fp32.
> 
> Bug: skia:7190
> Change-Id: Ieccff9f38acd05e5cec78fe90d01a5da901a9307
> Reviewed-on: https://skia-review.googlesource.com/70961
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,csmartdalton@google.com,ethannicholas@google.com

Change-Id: Idca2f0390e7a0eb85010255183f2f27332b8d26d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7190
Reviewed-on: https://skia-review.googlesource.com/72540
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-11-16 14:02:23 +00:00
Brian Osman
554c1f0508 Revert "Fold analytic clip FPs into GrReducedClip"
This reverts commit 4355b26b35.

Reason for revert: Most likely CL for layout test failures on Chrome roll: https://bugs.chromium.org/p/chromium/issues/detail?id=785931

Original change's description:
> Fold analytic clip FPs into GrReducedClip
> 
> Perf result on Pixel phone (sorted by impact):
> 
>   GEOMEAN                              7.44 -> 6.92 ms   [ 93%]
> 
>   keymobi_cnn_com.skp                  3.55 -> 3.59 ms   [101%]
>   keymobi_theverge_com.skp             4.08 -> 4.13 ms   [101%]
>   desk_skbug6850autoscroll.skp         1.21 -> 1.22 ms   [101%]
>   ...
>   top25desk_weather_com.skp            14.2 -> 11.5 ms   [ 81%]
>   keymobi_androidpolice_com_2012_.skp  3.84 -> 2.95 ms   [ 77%]
>   keymobi_shop_mobileweb_ebay_com.skp  2.94 -> 2.26 ms   [ 77%]
>   keymobi_boingboing_net.skp           3.08 -> 2.24 ms   [ 73%]
>   desk_jsfiddlebigcar.skp              1.90 -> 1.25 ms   [ 66%]
>   keymobi_m_youtube_com_watch_v_9.skp  13.5 -> 8.84 ms   [ 65%]
>   keymobi_sfgate_com_.skp              8.55 -> 5.55 ms   [ 65%]
>   keymobi_blogger.skp                  4.01 -> 2.60 ms   [ 65%]
> 
> Cleaner code, improved skps, slightly better geometric mean time.
> 
> Pixel C is mostly unaffected, presumably because it uses window
> rectangles.
> 
> Bug: skia:7190
> Change-Id: Ia93f68b2f971ea66b3ab19dc73557ea602932a92
> Reviewed-on: https://skia-review.googlesource.com/67424
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,csmartdalton@google.com

Change-Id: I86ff05196eaaeca4fb63836c9b449bbea76fe80b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7190
Reviewed-on: https://skia-review.googlesource.com/72480
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-11-16 13:57:01 +00:00
Chris Dalton
4355b26b35 Fold analytic clip FPs into GrReducedClip
Perf result on Pixel phone (sorted by impact):

  GEOMEAN                              7.44 -> 6.92 ms   [ 93%]

  keymobi_cnn_com.skp                  3.55 -> 3.59 ms   [101%]
  keymobi_theverge_com.skp             4.08 -> 4.13 ms   [101%]
  desk_skbug6850autoscroll.skp         1.21 -> 1.22 ms   [101%]
  ...
  top25desk_weather_com.skp            14.2 -> 11.5 ms   [ 81%]
  keymobi_androidpolice_com_2012_.skp  3.84 -> 2.95 ms   [ 77%]
  keymobi_shop_mobileweb_ebay_com.skp  2.94 -> 2.26 ms   [ 77%]
  keymobi_boingboing_net.skp           3.08 -> 2.24 ms   [ 73%]
  desk_jsfiddlebigcar.skp              1.90 -> 1.25 ms   [ 66%]
  keymobi_m_youtube_com_watch_v_9.skp  13.5 -> 8.84 ms   [ 65%]
  keymobi_sfgate_com_.skp              8.55 -> 5.55 ms   [ 65%]
  keymobi_blogger.skp                  4.01 -> 2.60 ms   [ 65%]

Cleaner code, improved skps, slightly better geometric mean time.

Pixel C is mostly unaffected, presumably because it uses window
rectangles.

Bug: skia:7190
Change-Id: Ia93f68b2f971ea66b3ab19dc73557ea602932a92
Reviewed-on: https://skia-review.googlesource.com/67424
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-11-16 03:57:25 +00:00
Chris Dalton
e421800227 Fix precision caps and rrect/ellipse effect precisions
Replaces all the complex precision caps with a single flag that says
whether "float" == fp32. Updates the ellipse and rrect effects to
use float coords, and use the scale workaround when float != fp32.

Bug: skia:7190
Change-Id: Ieccff9f38acd05e5cec78fe90d01a5da901a9307
Reviewed-on: https://skia-review.googlesource.com/70961
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-11-16 03:31:45 +00:00
Greg Daniel
0fb6db4be6 Revert "Add private grpixelconfigs for alpha_8 and alpha_half"
This reverts commit 33d17cbb00.

Reason for revert: broke intel bots

Original change's description:
> Add private grpixelconfigs for alpha_8 and alpha_half
> 
> Bug: skia:
> Change-Id: I5191b6e045aea2a5af2b305b5972ad1e638a7ace
> Reviewed-on: https://skia-review.googlesource.com/71763
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: I6fff9241f7878f1ec7fad2663df9922c9cd8f628
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/72180
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-11-15 20:49:03 +00:00
Brian Salomon
559f556d9d Remove support for image load/store
This isn't used and has become a maintenance burden.

Change-Id: I5f3af8f91e5c4f073fe4ea30e0a7f1f61efeea47
Reviewed-on: https://skia-review.googlesource.com/70640
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-15 20:06:12 +00:00
Greg Daniel
33d17cbb00 Add private grpixelconfigs for alpha_8 and alpha_half
Bug: skia:
Change-Id: I5191b6e045aea2a5af2b305b5972ad1e638a7ace
Reviewed-on: https://skia-review.googlesource.com/71763
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-11-15 20:02:43 +00:00
Greg Daniel
ab081ae7e4 Move static helper functions for GrPixelConfig to private.
Bug: skia:
Change-Id: I207cce77cbe46e0016afe932a06dba12e732c5da
Reviewed-on: https://skia-review.googlesource.com/71281
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-11-14 17:14:34 +00:00
Brian Osman
3e31e99bab Revert "Alloc glyph image correctly for SkMask::k3D_Format."
This reverts commit 1662257bda.

Reason for revert: Android still using this API

Original change's description:
> Alloc glyph image correctly for SkMask::k3D_Format.
> 
> Remove the no longer used outside Skia SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
> define, and either delete the code it guards or update it to use the new
> emboss mask filter factory.
> 
> Re-enable the code to test the emboss mask filter.
> 
> Add a test to ensure that embossed text is drawn correctly, as before
> glyphs did not allocate the proper amount of memory for the k3D_Format
> which the emboss mask filter produces.
> 
> Fixes SkEmbossMask::Emboss to write the whole of the mul and add planes
> to avoid pixel differences and MemorySanitizer errors.
> 
> Update the GPU to understand the k3D_Format and use just the alpha
> plane, ignoring the mul and add plane which it currently cannot support.
> 
> Change-Id: Icac1a3f37d6e8c6be3151df570f5e14111e18585
> Reviewed-on: https://skia-review.googlesource.com/70260
> Reviewed-by: Herb Derby <herb@google.com>
> Reviewed-on: https://skia-review.googlesource.com/70962
> Commit-Queue: Ben Wagner <bungeman@google.com>

TBR=djsollen@google.com,bungeman@google.com,herb@google.com

Change-Id: Id6625bae8d3bd70ce7aa3045348c04fdd146c637
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/71183
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-11-14 16:16:45 +00:00
Ben Wagner
1662257bda Alloc glyph image correctly for SkMask::k3D_Format.
Remove the no longer used outside Skia SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
define, and either delete the code it guards or update it to use the new
emboss mask filter factory.

Re-enable the code to test the emboss mask filter.

Add a test to ensure that embossed text is drawn correctly, as before
glyphs did not allocate the proper amount of memory for the k3D_Format
which the emboss mask filter produces.

Fixes SkEmbossMask::Emboss to write the whole of the mul and add planes
to avoid pixel differences and MemorySanitizer errors.

Update the GPU to understand the k3D_Format and use just the alpha
plane, ignoring the mul and add plane which it currently cannot support.

Change-Id: Icac1a3f37d6e8c6be3151df570f5e14111e18585
Reviewed-on: https://skia-review.googlesource.com/70260
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-on: https://skia-review.googlesource.com/70962
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-11-14 14:10:22 +00:00
Ben Wagner
3ae1a307f6 Revert "Alloc glyph image correctly for SkMask::k3D_Format."
This reverts commit 6b26deb8d6.

Reason for revert: GPU bots failing

Original change's description:
> Alloc glyph image correctly for SkMask::k3D_Format.
> 
> This removes the no longer used outside Skia
> SK_SUPPORT_LEGACY_EMBOSSMASKFILTER define, and either deletes the code
> it guards or updates it to use the new emboss mask filter factory. This
> re-enables the code to test the emboss mask filter. Also added is a test
> to ensure that embossed text is drawn correctly, as before this glyphs
> did not allocate the proper amount of memory for the k3D_Format which
> this mask filter produces. This also fixes SkEmbossMask::Emboss to write
> the whole of the mul and add planes to avoid pixel differences and
> MemorySanitizer errors.
> 
> Change-Id: Ib492c72a19d6a27d140e3cd48179a3ca9ce313f5
> Reviewed-on: https://skia-review.googlesource.com/70260
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Herb Derby <herb@google.com>

TBR=djsollen@google.com,bungeman@google.com,herb@google.com,reed@google.com

Change-Id: I8a9db6c00e0cb84bdd4833474a9ffffa6ecc606c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/70920
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-11-13 20:43:06 +00:00
Greg Daniel
5254ccc181 Move pixel config getter to private in GrBackendSurface
We eventually want to remove pixel config from GrBackendSurface so this
helps to insure that clients don't rely on it.

Bug: skia:
Change-Id: I6b8435d12347fab62c0f9032addea1211aa703ca
Reviewed-on: https://skia-review.googlesource.com/70642
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-11-13 20:39:51 +00:00
Ben Wagner
6b26deb8d6 Alloc glyph image correctly for SkMask::k3D_Format.
This removes the no longer used outside Skia
SK_SUPPORT_LEGACY_EMBOSSMASKFILTER define, and either deletes the code
it guards or updates it to use the new emboss mask filter factory. This
re-enables the code to test the emboss mask filter. Also added is a test
to ensure that embossed text is drawn correctly, as before this glyphs
did not allocate the proper amount of memory for the k3D_Format which
this mask filter produces. This also fixes SkEmbossMask::Emboss to write
the whole of the mul and add planes to avoid pixel differences and
MemorySanitizer errors.

Change-Id: Ib492c72a19d6a27d140e3cd48179a3ca9ce313f5
Reviewed-on: https://skia-review.googlesource.com/70260
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2017-11-13 20:26:21 +00:00
Ethan Nicholas
aae47c878b sksl enum support
Bug: skia:
Change-Id: I4d505b31cf8b59de12bcdbca410aafc085977ba9
Reviewed-on: https://skia-review.googlesource.com/68621
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-11-13 14:36:40 +00:00
Robert Phillips
2d9cb57c83 Revert "Patch up ref counting of proxies"
This reverts commit 8d5ce2d9ed.

Reason for revert: ASAN failures

Original change's description:
> Patch up ref counting of proxies
> 
> Bug: skia:
> Change-Id: If746283d788368bf7aad6d285f181d8531768e61
> Reviewed-on: https://skia-review.googlesource.com/70024
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: Ia2addb2a5dacad9e9c0080d1e53084bc62b780e0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/70540
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-11-13 13:38:11 +00:00
Robert Phillips
8d5ce2d9ed Patch up ref counting of proxies
Bug: skia:
Change-Id: If746283d788368bf7aad6d285f181d8531768e61
Reviewed-on: https://skia-review.googlesource.com/70024
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-11-13 13:22:20 +00:00
Mike Reed
48723156c5 remove legacy code for resolution
Bug: skia:
Change-Id: I6909325d4ee51140ec0edb47682de18617c23cc7
Reviewed-on: https://skia-review.googlesource.com/70100
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-11-10 19:59:47 +00:00
Greg Daniel
037d1fc453 Use vulkan prototypes for android framework build
The framework still directly calls vulkan vkGetInstanceProcAddr (and device).

Bug: skia:
Change-Id: Ie20a4fc4f58d0f51f995605dc8464a4e26b76602
Reviewed-on: https://skia-review.googlesource.com/69923
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-11-10 18:31:47 +00:00
Ethan Nicholas
1706f84208 switched GrClipEdge to an enum class
Bug: skia:
Change-Id: Idf41580314a32739c70721530fc3ca48e566b044
Reviewed-on: https://skia-review.googlesource.com/70023
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-11-10 17:42:27 +00:00
Greg Daniel
83bd441480 Set VK_NO_PROTOTYPES for vulkan backend
Bug: skia:
Change-Id: Id740efe6030b70271b0eb3a3bd6a111202f28fd8
Reviewed-on: https://skia-review.googlesource.com/69160
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2017-11-10 15:47:37 +00:00
Mike Reed
77e487dfc0 Revert "Revert "Remove MakeForLocalSpace since picture image is sufficient""
This reverts commit fc45998242.

Reason for revert: google3 updated (I think)

Original change's description:
> Revert "Remove MakeForLocalSpace since picture image is sufficient"
> 
> This reverts commit 0d8766c84c.
> 
> Reason for revert: broke google3
> 
> Original change's description:
> > Remove MakeForLocalSpace since picture image is sufficient
> > 
> > Bug: skia:
> > Change-Id: If38e702c418e93141311490edf447d1f09ed4434
> > Reviewed-on: https://skia-review.googlesource.com/68640
> > Commit-Queue: Mike Reed <reed@google.com>
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> 
> TBR=robertphillips@google.com,fmalita@chromium.org,reed@google.com
> 
> Change-Id: I3dec3d2c704e02b4db5977c27cc3e6d9f1c68ed5
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/69500
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=robertphillips@google.com,fmalita@chromium.org,reed@google.com

Change-Id: I5751fa637d280f361dea0f248a43c1f7e9bd8bdc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/69661
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-11-09 21:50:27 +00:00
Cary Clark
ba2526bc66 replace some points with vectors to clarify documentation
Some SkIPoint and SkPoint methods become clearer if their
parameters or return value is typed as a vector.

Since SkPoint is identical to SkVector (and SkIPoint is
identical to newly added SkIVector) this has no impact
on compiled code.

Some routines arguably have multiple possible point and
vector combinations which will be included in eventual
documentation; the interface should have the most common
and/or logical choice.

Some of my choices could be argued with as well. Does
SkPoint::Normalize take a SkPoint? Afternative points
of view encouraged.

R=reed@google.com,bsalomon@google.com
Bug: skia:6898
Change-Id: I2429b9d43b20351188d7c6433620a2e221f75bd8
Reviewed-on: https://skia-review.googlesource.com/69680
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-11-09 21:37:27 +00:00
Ethan Nicholas
0f3c73220a renamed GrPrimitiveEdgeType / GrProcessorEdgeType to GrClipEdgeType
Bug: skia:
Change-Id: I4a9af0b9b2cfa47875b2ba098098183e8dca29a7
Reviewed-on: https://skia-review.googlesource.com/69601
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-11-09 20:59:27 +00:00
Mike Reed
fc45998242 Revert "Remove MakeForLocalSpace since picture image is sufficient"
This reverts commit 0d8766c84c.

Reason for revert: broke google3

Original change's description:
> Remove MakeForLocalSpace since picture image is sufficient
> 
> Bug: skia:
> Change-Id: If38e702c418e93141311490edf447d1f09ed4434
> Reviewed-on: https://skia-review.googlesource.com/68640
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

TBR=robertphillips@google.com,fmalita@chromium.org,reed@google.com

Change-Id: I3dec3d2c704e02b4db5977c27cc3e6d9f1c68ed5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/69500
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-11-09 18:44:17 +00:00
Mike Klein
ea000ff330 remove SkFixedMul_arm()
The portable SkFixedMul_longlong (here now renamed SkFixedMul)
generates shorter, equivalent code,

from
   0:   fb81 0200       smull   r0, r2, r1, r0
   4:   ea4f 4010       mov.w   r0, r0, lsr #16
   8:   ea40 4002       orr.w   r0, r0, r2, lsl #16

to
   0:   fb81 0100       smull   r0, r1, r1, r0
   4:   0c00            lsrs    r0, r0, #16
   6:   ea40 4001       orr.w   r0, r0, r1, lsl #16

(Notice, 2 bytes saved.)

Change-Id: Icb0f7e6d4379086fc602f956a4beb1265a9759bc
Reviewed-on: https://skia-review.googlesource.com/69440
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-11-09 18:22:44 +00:00
Ben Wagner
e580649a38 Update doc and example for SkPaint::FontMetrics.
The underline position is actually the top of the underline. Also
clarify that the strike through position is the bottom of the strike
through.

This adds documentation that the values are always y-down in a way that
will end up in the SkPaint header file for those who look for
information there.

Change-Id: I40281c0e47557d23291b6a91474e2d3e3b37f09f
Docs-Preview: https://skia.org/user/api/SkPaint_Reference?cl=69361#FontMetrics
Reviewed-on: https://skia-review.googlesource.com/69361
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-11-09 18:20:14 +00:00
Ben Wagner
31366872a5 Guard VFPv3 ASM with an ifdef.
Change-Id: Id31de8dc0d9d68369896f2686068b29e07135a39
Reviewed-on: https://skia-review.googlesource.com/68641
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-11-09 17:46:44 +00:00
Mike Reed
0d8766c84c Remove MakeForLocalSpace since picture image is sufficient
Bug: skia:
Change-Id: If38e702c418e93141311490edf447d1f09ed4434
Reviewed-on: https://skia-review.googlesource.com/68640
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-11-09 16:49:44 +00:00
Robert Phillips
f8e2502819 Prepare to enable explicit gpu resource allocation (take 2)
Change-Id: I3fd78d53e8bea84c0217b9fe6e180eaa9e4ac753
Reviewed-on: https://skia-review.googlesource.com/68920
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-11-08 21:00:37 +00:00
Greg Daniel
065b41dd90 Revert "Prepare to enable explicit gpu resource allocation"
This reverts commit f290376736.

Reason for revert: Changed generated effect instead of FP

Original change's description:
> Prepare to enable explicit gpu resource allocation
> 
> Change-Id: I407e45711c61831febbac3d3d3a88e3fdde92c5f
> Reviewed-on: https://skia-review.googlesource.com/68212
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: I949500d94c7461b7cf38d615117cfcdc9a791780
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/68900
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-11-08 19:58:58 +00:00
Robert Phillips
f290376736 Prepare to enable explicit gpu resource allocation
Change-Id: I407e45711c61831febbac3d3d3a88e3fdde92c5f
Reviewed-on: https://skia-review.googlesource.com/68212
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-11-08 19:06:17 +00:00
Cary Clark
df429f3bea move parts of SkPoint to SkPointPriv
Move specialized SkPoint methods to SkPointPriv.
Use constexpr and inline initialization where possible.

R=reed@google.com,bsalomon@google.com
Bug: skia: 6898
Change-Id: I01ec5186f010f2dc80c068c70d9cc352f3221338
Reviewed-on: https://skia-review.googlesource.com/68700
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2017-11-08 18:25:17 +00:00
Mike Reed
12f77343ee add surfaceprops param to SkCanvas::MakeRasterDirect
Bug: skia:
Change-Id: I8b69280469cdf34c3c3cb126db9457a712143f88
Reviewed-on: https://skia-review.googlesource.com/68701
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-11-08 16:40:47 +00:00
Brian Salomon
821ef188b3 Allow mock GrContexts to "support" shader derivatives
Change-Id: I0d8dce5e0873a058b59baae9c35903b2444a76fd
Reviewed-on: https://skia-review.googlesource.com/68480
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-11-08 12:46:26 +00:00
Brian Salomon
af59748114 Add GrContextOptions to control distance field thresholds for small sizes and fallback to paths.
Change-Id: Ib57c40b1b50c5afe079b2099d1a83986629ea287
Reviewed-on: https://skia-review.googlesource.com/68217
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-08 01:34:06 +00:00
Brian Osman
63bc48d093 Add MakeCrossContextFromPixmap
This operates just like MakeCrossContextFromEncoded, but starting from
raster data. This version is defensive (always uses copies if a raster
image needs to be made).

Bug: skia:
Change-Id: Ibc2b9a235c89a41fbbfd022d943f15ac212d0677
Reviewed-on: https://skia-review.googlesource.com/68205
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-11-07 15:59:38 +00:00
Cary Clark
74f623d161 make point array methods private
Moved method are not used by chromium, google3,
or android.

SkPoint::setRectIFan isn't used or tested at all.

SkPoint::setRectFan and SkPoint::setRectTriStrip
are only used internally.

These routines pretend that a SkPoint is part
of an array of points. Since that's kind of an
odd contract to make public, and because they
aren't used outside of Skia, relegate them to
a priv file.

R=bsalomon@google.com,reed@google.com
Bug: skia: 6898
Change-Id: I5ec2eb47799f6fd4b2994da962b1fa69ce659931
Reviewed-on: https://skia-review.googlesource.com/68121
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-11-07 13:10:38 +00:00
Chris Dalton
fddb6c0399 Setup CCPR testing with GrMockContext
Beefs up the mock context to be able to support CCPR, sets up a
framework for testing CCPR with the mock context, and adds a new test.

Bug: skia:
Change-Id: If95f92726f7b1a7f52ad04ca8126551f58ea8032
Reviewed-on: https://skia-review.googlesource.com/67980
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-11-06 20:44:19 +00:00
Chris Dalton
e4aa0c4207 Disable CCPR while we sort out clipping
The current usage of CCPR by clipping code is suboptimal. This is
causing regressions on the bots and projects like Flutter that make
heavy use of clipPath. Disabling CCPR while we fix it up.

Bug: skia:7190
Bug: flutter:12839
Change-Id: I03af5249b53cf2eab5a13d85a5f87708030c8666
Reviewed-on: https://skia-review.googlesource.com/67920
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-11-06 16:40:39 +00:00
Brian Salomon
9f545bc18a Modify fontcache GM to actually spill atlas.
Adds an option to GrDrawOpAtlas to disable multitexturing.

Adds option to GrContextOptions to disable multitexturing for glyph atlases.


Change-Id: If413ab7061538fa0e75628d252be4fd14215b6ba
Reviewed-on: https://skia-review.googlesource.com/67802
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-06 16:06:09 +00:00
Leon Scroggins III
0cbc10f94e Make SkImageGeneratorCG apply encoded origin
SkImageGeneratorCG:
- Detect the origin and apply it to the output
- Deprecate NewFromEncodedCG and add MakeFromEncodedCG

SkCodecImageGenerator:
- Move code elsewhere for sharing
- Apply origin for incomplete decodes

SkPixmap.cpp/SkPixmapPriv.h:
- Now has the shared code for generators to apply origin

DMSrcSink.cpp:
- Call MakeFromEncodedCG

SkCGUtils.h:
- Add a version of SkCopyPixelsFromCGImage that takes an SkPixmap

Bug: skia:7138
Bug: skia:3834
Change-Id: Ic6dbc76360c6a84913b67373582f328d3946d637
Reviewed-on: https://skia-review.googlesource.com/63740
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-11-03 15:29:34 +00:00