Commit Graph

3594 Commits

Author SHA1 Message Date
halcanary
a5c0863d98 remove SkPurgeGlobalDiscardableMemoryPool
BUG=skia:2721
R=reed@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/495453004
2014-08-25 06:20:13 -07:00
Ben Wagner
da5a1b8cd8 Add testing flag for XPS for deterministic ids.
BUG=skia:455
R=mtklein@google.com

Review URL: https://codereview.chromium.org/494423002
2014-08-22 15:07:06 -04:00
fmalita
37ecbaffd1 [SkTextBlob] Merge run font data at draw time.
R=bungeman@google.com, reed@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/496773002
2014-08-22 09:01:20 -07:00
reed
8367b8cb7a extend SkShader to report a luminance-color to be used for gamma correction
BUG=skia:590
R=bungeman@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/492963002
2014-08-22 08:30:20 -07:00
joshualitt
30ba436f04 Initial refactor of shaderbuilder to prepare for geometry shaders
gitignore for eclipse

BUG=skia:
R=bsalomon@google.com, bsalomon@chromium.org

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/491673002
2014-08-21 20:18:45 -07:00
fmalita
c6765d69e3 Add some SkTextBlob builder tests.
R=reed@google.com, robertphillips@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/493443004
2014-08-21 15:03:04 -07:00
robertphillips
7eacd77ce6 SkMultiPictureDraw API
This CL adds a new API to optimize across multiple SkPicture draw calls.

Note that multiple pictures rendered at once (i.e., picture piles) should be flattened into a single new picture that includes the required clipping on the different layers.

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

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/491313003
2014-08-21 13:12:42 -07:00
robertphillips
64bf76722e Split up monolithic EXPERIMENTAL_drawPicture method
This is prep for the new multi-picture API.

This is split out of (Add new API to allow layer hoisting/atlasing across picture piles - https://codereview.chromium.org/474623002/)

R=bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/489103002
2014-08-21 13:07:35 -07:00
mtklein
c92e550d36 Install a hook to swap between SkPicture backends with a single define.
BUG=skia:
R=robertphillips@google.com, reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/492023002
2014-08-21 13:07:27 -07:00
bsalomon
c8dc1f74b6 Add GrResourceCache2.
Currently it just replaces GrGpu as the owner of the linked list of resources.

Committed: https://skia.googlesource.com/skia/+/94ce9ac8624dbb45656b8f5c992fad9c9ff3ee5f

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

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/481443002
2014-08-21 13:02:13 -07:00
mtklein
53fecfb15d Our SkPicture::Analysis visitors should recurse into nested pictures.
BUG=skia:
R=tomhudson@google.com, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/495793002
2014-08-21 09:11:38 -07:00
fmalita
00d5c2c652 SkTextBlob
Initial implementation.

R=bungeman@google.com, jbroman@chromium.org, mtklein@google.com, reed@google.com, robertphillips@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/473633002
2014-08-21 08:53:26 -07:00
reed
9fa60daad4 Simplify flattening to just write enough to call the factory/public-constructor for the class. We want to *not* rely on private constructors, and not rely on calling through the inheritance hierarchy for either flattening or unflattening(CreateProc).
Refactoring pattern:

1. guard the existing constructor(readbuffer) with the legacy build-flag
2. If you are a instancable subclass, implement CreateProc(readbuffer) to create a new instances from the buffer params (or return NULL).

If you're a shader subclass
1. You must read/write the local matrix if your class accepts that in its factory/constructor, else ignore it.

R=robertphillips@google.com, mtklein@google.com, senorblanco@google.com, senorblanco@chromium.org, sugoi@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/395603002
2014-08-21 07:59:51 -07:00
halcanary
af28dc6030 Make SkPMColorAssert a macro (all assert-like functions should be macros).
R=reed@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/494863003
2014-08-21 06:30:11 -07:00
reed
8bf3df68c5 remove code for (dead) SK_SUPPORT_LEGACY_GETCLIPTYPE
BUG=skia:
R=djsollen@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/489103003
2014-08-21 05:51:22 -07:00
mtklein
7b705bb17e Always read .skp files and other serialized pictures into SkRecord.
This should switch all our internal tools that aren't clever about it over to SkRecord pictures.  (The clever tools know what they're doing.)

Also, deletes the old SkPicture::clone() path.  return this or die.

BUG=skia:
R=robertphillips@google.com, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/481743003
2014-08-20 14:22:58 -07:00
mtklein
c551d9fcae Implement SkPicture::hasText() for SkRecord backend.
Plus, some small tweaks to the existing code surrounding it.  Just proposals,
will undo whatever you don't like.

BUG=skia:
R=mtklein@google.com, tomhudson@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/494683003
2014-08-20 08:09:46 -07:00
tomhudson
3a0f279167 Move the code over using the same template type approach previously used for willPlayBackBitmaps in http://skbug.com/2702.
Also unifies that flag and this one into a struct so they and others can be computed together. The struct is stored const to enforce lifetime expectations. Adds a few new cases to the unit test.

BUG=skia:2700
R=mtklein@google.com, reed@google.com, robertphillips@google.com, tomhudson@google.com

Committed: https://skia.googlesource.com/skia/+/60c2a79cfa8ceebcbafc243407564dc71f5e3b4f

Author: tomhudson@chromium.org

Review URL: https://codereview.chromium.org/364823009
2014-08-20 05:29:41 -07:00
piotaixr
d2a3522503 Add the method isOpaque() to SkImage
BUG=skia:2766
R=junov@chromium.org, halcanary@google.com, scroggo@google.com, reed@google.com, bsalomon@google.com

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/406673003
2014-08-19 14:29:02 -07:00
bsalomon
1d89ddc4a3 Revert of Add GrResourceCache2. (patchset #4 of https://codereview.chromium.org/481443002/)
Reason for revert:
Likely caused a leak detected in Chromium after last Skia roll.

Original issue's description:
> Add GrResourceCache2.
>
> Currently it just replaces GrGpu as the owner of the linked list of resources.
>
> Committed: https://skia.googlesource.com/skia/+/94ce9ac8624dbb45656b8f5c992fad9c9ff3ee5f

R=mtklein@google.com, robertphillips@google.com
TBR=mtklein@google.com, robertphillips@google.com
NOTREECHECKS=true
NOTRY=true

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/477323006
2014-08-19 14:20:58 -07:00
bungeman
31c4772b78 Treat embedded bitmaps as a hinting method.
R=reed@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/483313002
2014-08-19 13:18:58 -07:00
bsalomon
94ce9ac862 Add GrResourceCache2.
Currently it just replaces GrGpu as the owner of the linked list of resources.

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

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/481443002
2014-08-19 08:21:25 -07:00
caryclark
38dd9f2e41 remove unused SkIntToFloatCast_NoOverflowCheck
R=reed@google.com, reed
BUG=skia:2849

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/483273003
2014-08-19 07:39:41 -07:00
halcanary
97d2c0a216 Move SkReadBuffer.h and SkReader32.h out of include.
Committed: https://skia.googlesource.com/skia/+/2a51d7c74cec217195f861677de8998b382b39e4

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

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/481053002
2014-08-19 06:27:53 -07:00
Mike Klein
27dc17c297 Revert "Move the code over using the same template type approach previously used for willPlayBackBitmaps in http://skbug.com/2702."
This reverts commit 60c2a79cfa.

BUG=skia:

Review URL: https://codereview.chromium.org/481173003
2014-08-18 18:35:16 -04:00
tomhudson
60c2a79cfa Move the code over using the same template type approach previously used for willPlayBackBitmaps in http://skbug.com/2702.
Also unifies that flag and this one into a struct so they and others can be computed together. The struct is stored const to enforce lifetime expectations. Adds a few new cases to the unit test.

BUG=skia:2700
R=mtklein@google.com, reed@google.com, robertphillips@google.com, tomhudson@google.com

Author: tomhudson@chromium.org

Review URL: https://codereview.chromium.org/364823009
2014-08-18 15:07:13 -07:00
halcanary
f128f53a5b Revert "Move SkReadBuffer.h and SkReader32.h out of include."
This reverts commit 2a51d7c74c.

Breaking Blink

NOTRY=true
R=bungeman@google.com
TBR=bungeman@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/472303006
2014-08-18 13:48:13 -07:00
halcanary
2a51d7c74c Move SkReadBuffer.h and SkReader32.h out of include.
R=mtklein@google.com, reed@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/481053002
2014-08-18 13:04:59 -07:00
ajuma
750ae26745 Expose API for whether an SkPicture contains text
BUG=chromium:399728
R=reed@google.com, nduca@chromium.org

Author: ajuma@chromium.org

Review URL: https://codereview.chromium.org/478673002
2014-08-18 12:59:55 -07:00
halcanary
ea4673fde6 SkImage::NewFromGenerator(SkImageGenerator*), and a unit test.
R=reed@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/465823003
2014-08-18 08:27:09 -07:00
reed
bbe7a2ad32 eliminate code related to SkBitmap::Config
BUG=skia:
R=reed@google.com, mike@reedtribe.org

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/483593002
2014-08-18 08:13:03 -07:00
krajcevski
b1aded8edd Add flag to bench/render pictures
R=robertphillips@google.com, bsalomon@google.com

Author: krajcevski@google.com

Review URL: https://codereview.chromium.org/464423003
2014-08-18 07:52:17 -07:00
mtklein
5a246bb487 int SkPicture::approximateOpCount()
NOTREECHECKS=true

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/470333002
2014-08-14 19:17:21 -07:00
djsollen
3b6255493e Remove SkPaintOptionsAndroid
Committed: https://skia.googlesource.com/skia/+/f32331ffdb5de0440bb337aa7cbdd6f33e9ff23b

R=reed@google.com, mtklein@google.com, tomhudson@google.com

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/447873003
2014-08-14 06:29:03 -07:00
bsalomon
c15e28a522 Revert of Remove SkPaintOptionsAndroid (patchset #5 of https://codereview.chromium.org/447873003/)
Reason for revert:
Breaks the Chromium build: http://108.170.220.120:10117/builders/Canary-Chrome-Ubuntu13.10-Ninja-x86_64-DRT/builds/2469/steps/BuildContentShell_1/logs/stdio

Original issue's description:
> Remove SkPaintOptionsAndroid
>
> Committed: https://skia.googlesource.com/skia/+/f32331ffdb5de0440bb337aa7cbdd6f33e9ff23b

R=reed@google.com, mtklein@google.com, tomhudson@google.com, djsollen@google.com
TBR=djsollen@google.com, mtklein@google.com, reed@google.com, tomhudson@google.com
NOTREECHECKS=true
NOTRY=true

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/473543004
2014-08-13 15:18:46 -07:00
mtklein
6cfa73a29a Start tracking the CTM while filling the BBH in SkRecordDraw.
Depends on https://codereview.chromium.org/475473002/

BUG=skia:
R=robertphillips@google.com, reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/468193003
2014-08-13 13:33:49 -07:00
djsollen
f32331ffdb Remove SkPaintOptionsAndroid
R=reed@google.com, mtklein@google.com, tomhudson@google.com

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/447873003
2014-08-13 13:09:49 -07:00
krajcevski
69a5560ea5 Add entry point for passing options to the GrContextFactory
R=bsalomon@google.com, mtklein@google.com, robertphillips@google.com

Author: krajcevski@google.com

Review URL: https://codereview.chromium.org/465073002
2014-08-13 10:46:31 -07:00
tomhudson
c773390eef Delete the old font management implementation based on SkFontConfigInterface, now that SkFontMgr_Android is live.
BUG=chromium:400801
R=djsollen@google.com, bungeman@google.com

Author: tomhudson@chromium.org

Review URL: https://codereview.chromium.org/445143002
2014-08-13 10:41:25 -07:00
george
b62508be81 Add a parameter GR_ALWAYS_ALLOCATE_ON_HEAP to allow for only ever creating temporary buffers on the heap instead of allowing stack allocation
Unfortunately this can't be a GR_GL_* config like we'd discussed because there are SkAutoSMalloc buffers that are built outside of gl/

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

Author: george@mozilla.com

Review URL: https://codereview.chromium.org/459263003
2014-08-12 18:00:47 -07:00
halcanary
78ee93f545 Revert of SkImage::NewFromGenerator(SkImageGenerator*), and a unit test. (https://codereview.chromium.org/465823003/)
Reason for revert:
Mac bots are failing

Original issue's description:
> SkImage::NewFromGenerator(SkImageGenerator*), and a unit test.
>
> Committed: https://skia.googlesource.com/skia/+/186f7b04956a1742f185a4ca69b44b52bc50e7fc

R=reed@google.com
TBR=reed@google.com
NOTREECHECKS=true
NOTRY=true

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/453723003
2014-08-12 09:07:08 -07:00
tfarina
35fbd014e3 Migrate SkRTConfRegistry test to DEF_TEST().
BUG=None
TEST=dm --tests=true --gms=false
R=mtklein@google.com, bsalomon@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/444303002
2014-08-12 09:03:16 -07:00
dandov
b3c9d1c33c SkCanvas::drawPatch param SkPoint[12]
drawPatch now receives as parameter const SkPoint cubics[12]

Adjusted derived classes and serialization.

Ajusted GM's and benches that take into account combinations of optional
parameters, the scale of the patch and 4 different types of patches.

Planning on adding the extra functionality of SkPatch in another CL.

BUG=skia:
R=egdaniel@google.com, reed@google.com

Author: dandov@google.com

Review URL: https://codereview.chromium.org/463493002
2014-08-12 08:34:29 -07:00
halcanary
186f7b0495 SkImage::NewFromGenerator(SkImageGenerator*), and a unit test.
R=reed@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/465823003
2014-08-12 08:04:58 -07:00
krajcevski
9c6d4d744a Change GR_COMPRESS_ALPHA_MASK from compile-time flag to run-time. We do this by introducing an Options struct to be passed to a GrContext on creation.
R=robertphillips@google.com, bsalomon@google.com

Author: krajcevski@google.com

Review URL: https://codereview.chromium.org/459033002
2014-08-12 07:26:26 -07:00
reed
5b1b2dbe76 remove SkStippleMaskFilter - no external clients
TBR=

Author: reed@google.com

Review URL: https://codereview.chromium.org/462013002
2014-08-12 05:50:10 -07:00
bsalomon
d4cb922ea1 Consider index8 a compressed config.
R=krajcevski@google.com, robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/457333004
2014-08-11 14:19:09 -07:00
cdalton
c7103a104f Wrap NV_path_rendering API with GrGLPathRendering
Adds a GrGLPathRendering class that wraps the NV_path_rendering
extension and manages its various API versions. It also provides
backup implementations when certain NVpr methods from later API
versions are not present on the current system.

BUG=skia:
R=bungeman@google.com, bsalomon@google.com, kkinnunen@nvidia.com

Author: cdalton@nvidia.com

Review URL: https://codereview.chromium.org/444223002
2014-08-11 14:05:05 -07:00
reed
8572fc01ac mark all SkImage methods const, so we can make it thread-safe
BUG=skia:
R=mtklein@google.com, halcanary@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/453613003
2014-08-11 13:03:56 -07:00
bsalomon
9c0822a415 Always use both a color and coverage attribute in GrAARectRenderer.
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/435743002
2014-08-11 11:07:48 -07:00
mtklein
5ad6ee1b2c Plumbing for using a BBH in SkRecordDraw.
For now this only creates a degenerate bounding box hierarchy where all ops
just have maximal bounds.  I will flesh out FillBounds in future CL(s).

Not quite sure why QuadTree and TileGrid aren't drawing right---haven't even
looked at the diffs yet---so I've disabled those test modes for now.  RTree
seems fine, so that'll at least get us coverage for all this new plumbing.

BUG=skia:
R=robertphillips@google.com, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/454123003
2014-08-11 08:08:43 -07:00
reed
872e3dc89d Revert of Revert of remove (now unneeded) legacy onDrawPicture variant (https://codereview.chromium.org/457253002/)
Reason for revert:
webkit has been updated, so re-landing

Original issue's description:
> Revert of remove (now unneeded) legacy onDrawPicture variant (https://codereview.chromium.org/456203002/)
>
> Reason for revert:
> still need to update ProfilingCanvas in blink
>
> Original issue's description:
> > remove (now unneeded) legacy onDrawPicture variant
> >
> > TBR=fmalita@google.com
> >
> > Committed: https://skia.googlesource.com/skia/+/2e69d292e5a389db7d9264eb66172376692de8ca
>
> TBR=
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/47f9bdcc3d741a63935c52bfe85db44ab13f66f2

R=reed@chromium.org
TBR=reed@chromium.org
NOTREECHECKS=true
NOTRY=true

Author: reed@google.com

Review URL: https://codereview.chromium.org/460693002
2014-08-11 06:35:48 -07:00
reed
47f9bdcc3d Revert of remove (now unneeded) legacy onDrawPicture variant (https://codereview.chromium.org/456203002/)
Reason for revert:
still need to update ProfilingCanvas in blink

Original issue's description:
> remove (now unneeded) legacy onDrawPicture variant
>
> TBR=fmalita@google.com
>
> Committed: https://skia.googlesource.com/skia/+/2e69d292e5a389db7d9264eb66172376692de8ca

TBR=
NOTREECHECKS=true
NOTRY=true

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/457253002
2014-08-10 19:04:01 -07:00
reed
2e69d292e5 remove (now unneeded) legacy onDrawPicture variant
TBR=fmalita@google.com

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/456203002
2014-08-10 11:28:46 -07:00
reed
d5fa1a455a add drawPicture variant that takes a matrix and paint
will need some staging strategy, since chrome and blink have overrides of onDrawPicture

R=robertphillips@google.com, fmalita@google.com, bsalomon@google.com, mtklein@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/448793004
2014-08-09 11:08:05 -07:00
reed
3b1c3d2c61 add dummy onDrawPicture to allow migration for chrome overrides
after this lands in chrome, land these two CLs
https://codereview.chromium.org/454993002/
https://codereview.chromium.org/454143003

then land this skia CL
https://codereview.chromium.org/448793004/

then remove the onDrawPicture overrides from chrome

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/457753002
2014-08-08 12:51:24 -07:00
bungeman
4e3523cf54 Blink layout tests all assume it can provide custom font configuration files on every platform. In moving Android to the font manager, we broke those.
They're ugly, but this patch reinstates them.

R=tomhudson@google.com, djsollen@google.com, reed@google.com
TBR=reed@google.com
BUG=chromium:401954

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/451093002
2014-08-08 12:06:52 -07:00
joshualitt
bab82ed05b Pretty print of shaders
BUG=skia:
R=bsalomon@chromium.org, senorblanco@chromium.org, bsalomon@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/437593004
2014-08-08 09:41:42 -07:00
senorblanco
be129b26f1 Remove external SkImageFilter cache, and rename UniqueIDCache -> Cache.
There Can Only Be One.... Cache for SkImageFilter.

R=bsalomon@google.com

BUG=skia:

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/452923002
2014-08-08 07:14:35 -07:00
bsalomon
6eb03cc06d Add option to dump images from nanobench.
Add option to set the repeat count to any number, replacs the --runOnce flag.

R=mtklein@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/450743002
2014-08-07 14:28:50 -07:00
joshualitt
c863ab07c2 Cleanup of context initialization
Cleanup context initialization on linux

BUG=skia:
R=bsalomon@chromium.org, bsalomon@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/422323003
2014-08-07 13:48:50 -07:00
krajcevski
95b1b3d82d Add astcbitmap to gm slides.
Add additional ASTC formats.
Add astc image decoder files.

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

Author: krajcevski@google.com

Review URL: https://codereview.chromium.org/444093002
2014-08-07 12:58:38 -07:00
krajcevski
7b62448065 Revert of - Add astcbitmap to gm slides (https://codereview.chromium.org/444093002/)
Reason for revert:
Breaking DM

Original issue's description:
> - Add astcbitmap to gm slides
> - Add additional ASTC formats
> - Add astc image decoder files
>
> Committed: https://skia.googlesource.com/skia/+/2fc05823fed4b9649338f3029cd1ba05ef49a02f

R=reed@google.com, robertphillips@google.com, halcanary@google.com
TBR=halcanary@google.com, reed@google.com, robertphillips@google.com
NOTREECHECKS=true
NOTRY=true

Author: krajcevski@google.com

Review URL: https://codereview.chromium.org/447343002
2014-08-07 11:33:59 -07:00
krajcevski
2fc05823fe - Add astcbitmap to gm slides
- Add additional ASTC formats
- Add astc image decoder files

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

Author: krajcevski@google.com

Review URL: https://codereview.chromium.org/444093002
2014-08-07 11:18:09 -07:00
dandov
963137b75c Stopped skipping tests in dm of SkPatch by implementing the
corresponding drawPath calls on classes that derive from SkCanvas.

BUG=skia:
R=egdaniel@google.com, bsalomon@google.com, mtklein@google.com, robertphillips@google.com

Author: dandov@google.com

Review URL: https://codereview.chromium.org/429343004
2014-08-07 07:49:53 -07:00
Derek Sollenberger
da7a944e29 Revert "Remove SkPaintOptionsAndroid"
This reverts commit 27fb94999b.

Review URL: https://codereview.chromium.org/450513002
2014-08-06 16:34:40 -04:00
Derek Sollenberger
27fb94999b Remove SkPaintOptionsAndroid
Review URL: https://codereview.chromium.org/447873003
2014-08-06 16:30:51 -04:00
fmalita
b5f7826c51 Explicit tile bounds for SkPictureShader
The integer picture size is not granular enough to allow precise tiling
in arbitrary coordinate systems. This CL adds an optional tile bounds
float rect param to control the tile size and location.

(this also allows tile spacing emulation for picture
shaders).

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

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/437393003
2014-08-06 13:07:15 -07:00
krajcevski
53f0959fc0 Allow custom blitters to be passed to SkDraw::drawPath
R=reed@google.com

Author: krajcevski@google.com

Review URL: https://codereview.chromium.org/444003004
2014-08-06 11:12:14 -07:00
bungeman
760ba8d392 Revert "Adds a GrGLPathRendering class that wraps the NV_path_rendering"
This reverts commit 5672da0fa5.

This appears to be blocking the Skia roll by causing failures in the blink layout tests on the canvas-lost-gpu-context.html test.

The bisect for this can be seen at:

https://codereview.chromium.org/449473002/

Original issue's description:
> Adds a GrGLPathRendering class that wraps the NV_path_rendering
> extension and manages its various API versions. It also provides
> backup implementations when certain NVpr methods from later API
> versions are not present on the current system.
>
> Committed: https://skia.googlesource.com/skia/+/5672da0fa54f31c9727568e9dd5fe82c6e1585bc
2014-08-06 11:15:50 -04:00
djsollen
1b27704eba Remove ALL font fallback logic from Skia.
R=reed@google.com, bungeman@google.com, caryclark@google.com

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/434623002
2014-08-06 06:58:06 -07:00
mtklein
847092c88b SkThreadPool and co. are not public.
BUG=skia:
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/444583006
2014-08-06 06:55:12 -07:00
ch.dumez
43f9d3edf8 Expose SkColorTable class
Expose SkColorTable class as it is used in SkBitmap::allocPixels(SkColorTable*)
API, which is already exposed.

R=reed@google.com, ben@chromium.org

Author: ch.dumez@samsung.com

Review URL: https://codereview.chromium.org/418173011
2014-08-05 12:20:19 -07:00
egdaniel
6d7f5faeb3 Enable gpu Debug markers if tracing category skia.gpu is enabled
BUG=skia:
R=bsalomon@google.com

Author: egdaniel@google.com

Review URL: https://codereview.chromium.org/438023004
2014-08-04 12:54:39 -07:00
cdalton
5672da0fa5 Adds a GrGLPathRendering class that wraps the NV_path_rendering
extension and manages its various API versions. It also provides
backup implementations when certain NVpr methods from later API
versions are not present on the current system.

R=bsalomon@google.com, kkinnunen@nvidia.com, markkilgard@gmail.com

Author: cdalton@nvidia.com

Review URL: https://codereview.chromium.org/437473002
2014-08-04 11:19:11 -07:00
bsalomon
0673676854 Don't compare coord change matrices to determine effect compatibility when using explicit local coords.
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/438053002
2014-08-04 10:56:40 -07:00
dandov
ecfff21bde SkCanvas interface for drawing a patch.
Added function SkCanvas::drawPatch to the API. This function
receives the patch to draw and the paint.

Added function SkBaseDevice::drawPatch to the API. This function also receives the patch to draw and the paint.

Currently SkGpuDevice and SkBitmapDevice generate the mesh taking into
account the scale factor and call the corresponding device's drawVertices.

BUG=skia:
R=jvanverth@google.com, egdaniel@google.com, bsalomon@google.com

Author: dandov@google.com

Review URL: https://codereview.chromium.org/424663006
2014-08-04 10:02:00 -07:00
bsalomon
01c8da1eef Remove unused matrix param from GrContext/GrDrawTarget rect drawing functions.
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/441623005
2014-08-04 09:21:30 -07:00
george
c4ade57cd4 Ensure that SkDebugf is exported from the library.
This was caused by the change to always call SkDebugf() in SkASSERT(). There are many headers in Skia that call SkASSERT and so we were seeing linking issues in Gecko where we were using Skia across DLL boundaries.

R=reed@google.com, bsalomon@google.com, reed1
BUG=skia:

Author: george@mozilla.com

Review URL: https://codereview.chromium.org/438783002
2014-08-01 12:02:07 -07:00
Derek Sollenberger
3836dc80a6 Remove copile time enabling of SK_ARM_HAS_NEON.
We need to know this in our build system so that we can include
the necessary neon CPP files.

R=mtklein@google.com

Review URL: https://codereview.chromium.org/432453003
2014-08-01 09:21:19 -04:00
djsollen
21769c5249 Update NEON compiler defines to use SK_ prefix
BUG=skia:2785
R=mtklein@google.com

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/433513004
2014-08-01 05:32:32 -07:00
senorblanco
55b6d8be99 Implement a persistent uniqueID-based cache for SkImageFilter.
Add a unique ID to SkImageFilter, and use it as part
of a persistent cache of image-filtered results. This is used for
caching frame-to-frame coherent filters.

We also keep track of which filter subtrees do not reference the
src input, and use a GenID of zero for the src input in that case.
That way, subtrees which are not dependent on the filter input can be
cached independently of it.

This gives approximately a 4X speedup on
letmespellitoutforyou.com/samples/svg/filter_terrain.svg on Z620
and Nexus10. The cache key consists of the uniqueID of the filter, the
clip bounds, the CTM and the genID of the input bitmap.

Since this does not yet handle the case where the input primitives
(and part of the resulting filter tree) are unchanged, we have
to keep around the external cache for that painting case.
When the work to cache unchanging input primitives is done, the
old cache can be removed, and the new UniqueIDCache will be renamed
to Cache.

R=bsalomon@google.com, mtklein@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/414483003
2014-07-30 11:26:46 -07:00
cdalton
c8f5204667 Incorporate glStencilThenCover* nvpr methods
Adds the glStencilThenCover* nvpr methods to GrGLInterface and starts
using them. When drawing multible paths, this will make it so we only
have to send the index/transform data once. It will also allow the
driver to save time internally.

The glStencilThenCover* methods are a newer addition, so they aren't
available on every driver. In the event that they are not present, we
emulate them using the existing glStencil*/glCover* methods.

BUG=skia:
R=markkilgard@gmail.com, bsalomon@google.com

Author: cdalton@nvidia.com

Review URL: https://codereview.chromium.org/423173004
2014-07-29 15:25:51 -07:00
egdaniel
b414f25cf9 Remove support in the gpu to use hardware AA lines. Current code paths could not reach this code and thus was never used.
The blend opt flag kDisableBlend should now be able to be removed, however it is left in this CL and will removed in its own.

BUG=skia:
R=bsalomon@google.com

Author: egdaniel@google.com

Review URL: https://codereview.chromium.org/427823002
2014-07-29 13:15:47 -07:00
egdaniel
b09bdd6bac Revert of Remove gpu support for willUseHWAALines. (https://codereview.chromium.org/423943003/)
Reason for revert:
Breaking windows 7 compare gm's

Original issue's description:
> Remove gpu support for willUseHWAALines.
>
> By removing willUseHWAALines, we also no long reference the blend opt flag kDisableBlend so it has been removed
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/e6dfba868c19b00562f8c733b9bf37dd4ec9e68c

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

Author: egdaniel@google.com

Review URL: https://codereview.chromium.org/430493003
2014-07-29 08:52:23 -07:00
bsalomon
944bcf0acb Some fixes around GrContext::abandonContext:
Fix debug crash when GrResourceCache is destroyed after GrContext is abandoned while GrTextures are in the exlusive list.

Notify debug GL context that GL resources are expected to remain undeleted when context is destroyed after being abandoned.

Stop leaking program cache entries when context is abandoned.

R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/422323002
2014-07-29 08:01:52 -07:00
egdaniel
e6dfba868c Remove gpu support for willUseHWAALines.
By removing willUseHWAALines, we also no long reference the blend opt flag kDisableBlend so it has been removed

BUG=skia:
R=bsalomon@google.com

Author: egdaniel@google.com

Review URL: https://codereview.chromium.org/423943003
2014-07-29 07:51:03 -07:00
kkinnunen
4509517e03 Use if instead of ifdef SK_SUPPORT_GPU
The SK_SUPPORT_GPU is always defined.

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

Author: kkinnunen@nvidia.com

Review URL: https://codereview.chromium.org/331353003
2014-07-29 06:12:49 -07:00
tfarina
a8e2e1504b Cleanup: Rename SkOSPath functions.
Mostly for brevity and matches better with Python:

Python           | Old C++                 | New C++
os.path.join     | SkOSPath::SkPathJoin    | SkOSPath::Join
os.path.basename | SkOSPath::SkBasename    | SkOSPath::Basename

BUG=None
TEST=make all
R=mtklein@google.com, bsalomon@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/428443002
2014-07-28 19:26:58 -07:00
bsalomon
2354f8432a Test abandoning GL context in dm/nanobench.
Rename GrContext::contextDestroyed to GrContext::abandonContext.

Remove GrContext::resetContext.

R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/422903002
2014-07-28 13:48:36 -07:00
bsalomon
4beef91ec0 Revert of Remove relative path to GrColor.h in SkShader.h (https://codereview.chromium.org/422023005/)
Reason for revert:
As Ben suspected, this breaks the chrome build.

Original issue's description:
> Remove relative path to GrColor.h in SkShader.h
>
> Committed: https://skia.googlesource.com/skia/+/939f430f660d26e46116a38d2a8436afbd55dfb9

R=bungeman@google.com, george@mozilla.com
TBR=bungeman@google.com, george@mozilla.com
NOTREECHECKS=true
NOTRY=true

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/423943005
2014-07-28 13:43:04 -07:00
bsalomon
939f430f66 Remove relative path to GrColor.h in SkShader.h
R=bungeman@google.com, george@mozilla.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/422023005
2014-07-28 13:27:35 -07:00
Derek Sollenberger
9ee1a4a460 Remove redundant helper function as all clients pass locale
R=tomhudson@google.com

Review URL: https://codereview.chromium.org/426643003
2014-07-28 10:04:55 -04:00
Derek Sollenberger
e83a7ecfd7 Remove unused code now that the android framework has move this logic elsewhere.
R=tomhudson@google.com

Review URL: https://codereview.chromium.org/424663005
2014-07-28 09:54:10 -04:00
bungeman
d6aeb6dc8f Fix thread unsafe mutex initialization.
BUG=skia:2779
R=robertphillips@google.com, mtklein@google.com, reed@android.com, bsalomon@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/419113002
2014-07-25 11:52:48 -07:00
dandov
50d715476b Added classes SkPatch and SkPatchMesh which help encapsulate and generalize this new primitive. The functionality and responsability of each class is better explained in the comments of the files.
Each patch defines a method genMesh that produces the geometry to draw. To do this they receive a SkPatchMesh object which they need to initialize in order to set up how the data is going to be formatted. Later they call function like setColor or pointAt to set the values at a specific index, the SkMeshPatch object handles the indices based on the format and makes it transparent to the client.

Added a slide to sample app to show how to set up this classes and how they interact.

BUG=skia:
R=jvanverth@google.com, egdaniel@google.com, bsalomon@google.com

Author: dandov@google.com

Review URL: https://codereview.chromium.org/405163003
2014-07-25 10:44:54 -07:00
bsalomon
6d3fe022d6 Rename GrGpuObject to GrGpuResource
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/418143004
2014-07-25 08:35:45 -07:00
bsalomon
c44be0e9e4 Merge GrGpuObject and GrCacheable.
We want to create a new base class for "meta" gr resources as part of the GrResourceCache rewrite and this is an iterim step towards that goal.s

R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/414013005
2014-07-25 07:32:33 -07:00
krajcevski
2a413df4da Add ASTC to list of alpha compressed formats
R=bsalomon@google.com, robertphillips@google.com

Author: krajcevski@google.com

Review URL: https://codereview.chromium.org/412113004
2014-07-24 08:16:01 -07:00
piotaixr
76d5b477c9 Now able to set the localMatrix when creating a SkShader from a SkImage
BUG=skia:2771
R=junov@chromium.org, reed@chromium.org, bsalomon@chromium.org, bsalomon@google.com

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/409653003
2014-07-22 15:02:05 -07:00
jvanverth
dd6d22751a Replace use of GrTHashTable in GrFontCache with SkTDynamicHash.
Searching the font cache for existing text strikes was showing up
as a hotspot on Android. This change reduces that cost.

R=bsalomon@google.com, robertphillips@google.com, mtklein@google.com

Author: jvanverth@google.com

Review URL: https://codereview.chromium.org/390103002
2014-07-22 13:25:26 -07:00
bsalomon
1c63bf6e90 Revert "Revert of Use the GrCacheable ID to eliminate the need for notifications to GrGpuGL when textures and RTs are… (https://codereview.chromium.org/376703009/)"
This reverts commit 249171e7d2.

Uses 32 bit id instead of 64. Renamed instanceID to uniqueID to match existing code.

R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/414493002
2014-07-22 13:09:46 -07:00
senorblanco
bc9845bb60 Remove the single-sigma version of SkDropShadowImageFilter::Create().
It's no longer used in Chrome.

BUG=skia:
R=bsalomon@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/407203002
2014-07-22 12:49:25 -07:00
bsalomon
be035702f3 Remove unused enum value and member of GrGpuObject
R=robertphillips@google.com
TBR=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/413523002
2014-07-22 11:17:14 -07:00
robertphillips
d771f6bc27 Add auto purging for SkPicture-related Ganesh resources (esp. layers)
This is intended to lower the bookkeeping burden for the Layer Caching feature. Cached layers are now automatically purged when a picture is deleted.

R=bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/408923002
2014-07-22 10:18:06 -07:00
caryclark
17f0b6df72 share dm and command flags
Share command flags between dm and unit tests.
Also, allow dm's core to be included by itself and iOSShell.

Command line flags that are the same (or nearly the same) in DM
and in skia_tests have been moved to common_flags. Authors,
please check to see that the shared common flag is correct for
the tool.

For iOS, the 'tool_main' entry point has a wrapper to allow multiple
tools to be statically linked in the iOSShell.
Since SkCommandLineFlags::Parse can only be called once, these calls
are disabled in the IOS build.

Since the iOS app directory is dynamically assigned a name, use '@' to
select it. (This is the same convention chosen by the Mobile Harness
iOS file system utilities.)

Move the heart of dm.gyp into dm.gypi so that it can be included by
itself and iOSShell.gyp.

Add tools/flags/SkCommonFlags.* to define and declare common
command line flags.

Add support for dm to iOSShell.

BUG=skia:
R=scroggo@google.com, mtklein@google.com, jvanverth@google.com, bsalomon@google.com

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/389653004
2014-07-22 10:15:35 -07:00
joshualitt
ac9779234e Initial change to move 2D kernel to its own file.
BUG=skia:
R=bsalomon@chromium.org, senorblanco@chromium.org, bsalomon@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/379253003
2014-07-22 09:52:12 -07:00
cdalton
b85a0aab69 Add a GrPathRange class
Adds a GrPathRange object that represents a range of paths on the gpu.
Updates GrDrawTarget::drawPaths and supporting code to use GrPathRange
instead of an array of GrPath objects.

Change-Id: I67845f3893cd4d955db947d699aa3733cbb081e0

BUG=skia:
R=bsalomon@google.com, jvanverth@google.com, kkinnunen@nvidia.com

Author: cdalton@nvidia.com

Review URL: https://codereview.chromium.org/400713003
2014-07-21 15:32:44 -07:00
bsalomon
dcabb05113 Make GrCacheable implement its own ref counting.
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/392333008
2014-07-21 14:24:01 -07:00
sugoi
518d83dbc1 Skia side RGB to YUV gpu conversion
This code is the one that's currently working in my local chromium build. A few things still need to be addressed and I'll highlight these directly in the code.

BUG=skia:
R=reed@google.com, bsalomon@google.com, senorblanco@google.com, senorblanco@chromium.org, robertphillips@google.com, scroggo@google.com, halcanary@google.com

Author: sugoi@chromium.org

Review URL: https://codereview.chromium.org/374743003
2014-07-21 11:37:39 -07:00
bsalomon
63e99f7a03 Allow GrGLEffects to produce variable length keys.
R=robertphillips@google.com, jvanverth@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/385713005
2014-07-21 08:03:14 -07:00
reed
3f8540346d hide public factory for intermediate class
Use SK_DECLARE_UNFLATTENABLE_OBJECT if the subclass should not be directly instantiated.

TBR=

Author: reed@google.com

Review URL: https://codereview.chromium.org/399383007
2014-07-21 07:31:53 -07:00
dominikg
1bd6f7de52 Remove use of SK_SUPPORT_LEGACY_LAYERRASTERIZER_API.
Mozilla have removed any uses of the legacy API from their Moz2D code.
Since they were the last users we know of, we can remove the legacy API.

BUG=skia:2187
R=scroggo@google.com, reed@google.com

Author: dominikg@chromium.org

Review URL: https://codereview.chromium.org/402613003
2014-07-21 02:43:20 -07:00
robertphillips
249171e7d2 Revert of Use the GrCacheable ID to eliminate the need for notifications to GrGpuGL when textures and RTs are… (https://codereview.chromium.org/376703009/)
Reason for revert:
Trying to unblock roll wedged on 64 bit intrinsic call on XP

Original issue's description:
> Use the GrCacheable ID to eliminate the need for notifications to GrGpuGL when textures and RTs are deleted.
>
> Also, rename GrCacheable::getGenerationID() to getInstanceID() since it doesn't behave like other "generation" IDs.
>
> Committed: https://skia.googlesource.com/skia/+/91bdbcdbbdf5cdf0fdb4518a0d30206c964cfdf6

R=jvanverth@google.com, bsalomon@google.com
TBR=bsalomon@google.com, jvanverth@google.com
NOTREECHECKS=true
NOTRY=true

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/405023003
2014-07-20 09:21:02 -07:00
bungeman
733418f91e Remove SkRefPtr.
R=mtklein@google.com, reed@google.com, bsalomon@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/393913002
2014-07-17 12:17:55 -07:00
cdalton
8dd90cb1fd Add IsPath to GrGLInterface
This will be used by path ranges.

BUG=skia:
R=bsalomon@google.com

Author: cdalton@nvidia.com

Review URL: https://codereview.chromium.org/403563002
2014-07-17 09:28:36 -07:00
bsalomon
91bdbcdbbd Use the GrCacheable ID to eliminate the need for notifications to GrGpuGL when textures and RTs are deleted.
Also, rename GrCacheable::getGenerationID() to getInstanceID() since it doesn't behave like other "generation" IDs.

R=jvanverth@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/376703009
2014-07-17 09:28:07 -07:00
bsalomon
929f29a5c1 Makes GrGLProgramDesc's key store the lengths as well as offsets of the effect keys.
Makes it possible to use GrBackendEffectFactories other than GrTBEF by moving meta-key generation out of GrTBEF.

Cleans up docs around GrBackendEffectFactory.

Committed: https://skia.googlesource.com/skia/+/c0ea398aff8254e31152cbb94c9ab6150428e252

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

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/379113004
2014-07-17 07:55:11 -07:00
reed
b959ec7815 factor out flattening/unflattening of common fields from SkImageFilter
This is a precursor to changing SkImageFilters (and all effects) to unflatten via a factory instead of a constructor. In that world, each subclass of ImageFilter will need to control/initiate the unflattening of the common fields, so they can be extract and passed to their Factory.

R=senorblanco@google.com, robertphillips@google.com, mtklein@google.com, senorblanco@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/395273002
2014-07-17 07:03:09 -07:00
halcanary
805ef159d1 Set maximum output size for scaled-image-cache images
Accessable via:
  SkScaledImageCache::{G,S}etMaximumOutputSizeForHighQualityFilter

Also, a unit test.

BUG=389439
R=humper@google.com, tomhudson@google.com, reveman@chromium.org, vangelis@chromium.org, reed@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/394003003
2014-07-17 06:58:01 -07:00
krajcevski
7ef21622b2 Add new ASTC pixel config
R=bsalomon@google.com, robertphillips@google.com

Author: krajcevski@google.com

Review URL: https://codereview.chromium.org/399623004
2014-07-16 15:21:14 -07:00
Mike Klein
0b4cc892cb Disable assertion of fBoundsIsDirty.
We allow this to be raced on, and it may have already become not-dirty by the
time we get to this function if computed by another thread.

BUG=skia:

Review URL: https://codereview.chromium.org/398913002
2014-07-16 17:18:20 -04:00
joshualitt
ee5da55477 32 bpp floating point textures
This is VERY preliminary, but it was sufficient for me to get 32 bit floating point textures in a sample app

BUG=skia:
R=bsalomon@chromium.org, bsalomon@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/359803003
2014-07-16 13:32:56 -07:00
Mike Klein
e7fd6db41a Remove yet-unused 64-bit atomic hooks.
For now, I think we'll just be using sk_atomic_inc on 64-bit values, so
let's cut out the dead code for now.

NOTREECHECKS=true

BUG=skia:
R=bsalomon@google.com

Review URL: https://codereview.chromium.org/398003004
2014-07-16 15:20:58 -04:00
mtklein
7940100fae Revert of Makes GrGLProgramDesc's key store the lengths as well as offsets of the effect keys. (https://codereview.chromium.org/379113004/)
Reason for revert:
Most likely candidate for Valgrind failures:

[21:10:08.755668] ==3036== Use of uninitialised value of size 8
[21:10:08.755753] ==3036==    at 0x734AB2: GrGpuGL::ProgramCache::getProgram(GrGLProgramDesc const&, GrEffectStage const**, GrEffectStage const**) (GrGpuGL_program.cpp:107)
[21:10:08.755788] ==3036==    by 0x734ED2: GrGpuGL::flushGraphicsState(GrGpu::DrawType, GrDeviceCoordTexture const*) (GrGpuGL_program.cpp:253)
[21:10:08.755811] ==3036==    by 0x6E81C2: GrGpu::setupClipAndFlushState(GrGpu::DrawType, GrDeviceCoordTexture const*, GrDrawState::AutoRestoreEffects*, SkRect const*) (GrGpu.cpp:350)
[21:10:08.755837] ==3036==    by 0x6E9BE8: GrGpu::onDraw(GrDrawTarget::DrawInfo const&) (GrGpu.cpp:390)
[21:10:08.755858] ==3036==    by 0x6EEECE: GrInOrderDrawBuffer::flush() (GrDrawTarget.h:506)
[21:10:08.755879] ==3036==    by 0x6D0EB4: GrContext::flush(int) (GrContext.cpp:1327)
[21:10:08.755900] ==3036==    by 0x6D3F8F: GrContext::writeTexturePixels(GrTexture*, int, int, int, int, GrPixelConfig, void const*, unsigned long, unsigned int) (GrContext.cpp:1349)
[21:10:08.755922] ==3036==    by 0x6D39D7: GrContext::writeRenderTargetPixels(GrRenderTarget*, int, int, int, int, GrPixelConfig, void const*, unsigned long, unsigned int) (GrContext.cpp:1632)
[21:10:08.755949] ==3036==    by 0x6FFDF3: GrRenderTarget::writePixels(int, int, int, int, GrPixelConfig, void const*, unsigned long, unsigned int) (GrRenderTarget.cpp:45)
[21:10:08.755978] ==3036==    by 0x735563: SkGpuDevice::onWritePixels(SkImageInfo const&, void const*, unsigned long, int, int) (SkGpuDevice.cpp:280)
[21:10:08.756003] ==3036==    by 0x57A048: SkBaseDevice::writePixels(SkImageInfo const&, void const*, unsigned long, int, int) (SkDevice.cpp:106)
[21:10:08.756025] ==3036==    by 0x56D0AE: SkCanvas::writePixels(SkImageInfo const&, void const*, unsigned long, int, int) (SkCanvas.cpp:700)
[21:10:08.756050] ==3036==    by 0x56D156: SkCanvas::writePixels(SkBitmap const&, int, int) (SkCanvas.cpp:652)
[21:10:08.756077] ==3036==    by 0x5109B6: test_WritePixels(skiatest::Reporter*, GrContextFactory*) (WritePixelsTest.cpp:464)
[21:10:08.756099] ==3036==    by 0x51114C: skiatest::WritePixelsClass::onRun(skiatest::Reporter*) (WritePixelsTest.cpp:361)
[21:10:08.756122] ==3036==    by 0x406BE8: skiatest::Test::run() (Test.cpp:107)
[21:10:08.756145] ==3036==    by 0x4064C2: SkTestRunnable::run() (skia_test.cpp:109)
[21:10:08.756167] ==3036==    by 0x405D1A: tool_main(int, char**) (skia_test.cpp:221)
[21:10:08.756189] ==3036==    by 0x405F75: main (skia_test.cpp:239)
[21:10:08.756211] ==3036==  Uninitialised value was created by a stack allocation
[21:10:08.756233] ==3036==    at 0x734CC8: GrGpuGL::flushGraphicsState(GrGpu::DrawType, GrDeviceCoordTexture const*) (GrGpuGL_program.cpp:213)

Original issue's description:
> Makes GrGLProgramDesc's key store the lengths as well as offsets of the effect keys.
>
> Makes it possible to use GrBackendEffectFactories other than GrTBEF by moving meta-key generation out of GrTBEF.
>
> Cleans up docs around GrBackendEffectFactory.
>
> Committed: https://skia.googlesource.com/skia/+/c0ea398aff8254e31152cbb94c9ab6150428e252

R=robertphillips@google.com, jvanverth@google.com, bsalomon@google.com
TBR=bsalomon@google.com, jvanverth@google.com, robertphillips@google.com
NOTREECHECKS=true
NOTRY=true

Author: mtklein@google.com

Review URL: https://codereview.chromium.org/394213002
2014-07-16 06:16:43 -07:00
scroggo
0847059fcf Remove kImageIsImmutable_Flag.
This flag was only used when setting or checking SkBitmap's
immutability when it did not have an SkPixelRef. Now that an
SkBitmap *must* have one in order to draw (e.g. you can no
longer have an SkBitmap that owns its pixels directly), its
immutabity without an SkPixelRef makes no sense.

Also, now that the flags are not contiguous starting from
0x01, use a more appropriate check to ensure only meaningful
flags are used.

R=reed@google.com

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/387083002
2014-07-15 19:56:48 -07:00
bsalomon
c0ea398aff Makes GrGLProgramDesc's key store the lengths as well as offsets of the effect keys.
Makes it possible to use GrBackendEffectFactories other than GrTBEF by moving meta-key generation out of GrTBEF.

Cleans up docs around GrBackendEffectFactory.

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

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/379113004
2014-07-15 19:41:17 -07:00
mtklein
a179a1ede9 SkAutoRef seems lonely. Might as well delete it.
(On the other hand, SkAutoUnref is well-used.)

NOTREECHECKS=true

BUG=skia:
R=bungeman@google.com, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/393953004
2014-07-15 13:29:34 -07:00
scroggo
352c2181d1 Change SkCanvasState to use inheritance.
The base class, SkCanvasState, now holds the version, width, and
height. These fields will always be a necessary part of the class.
(Also add in some padding.)
The other fields, which may change, have been moved into the
subclass, SkCanvasState_v1. If/when the version changes, it will
correspond to a new subclass.
In SkCanvasStateUtils::CreateFromCanvasState, check the version on
the base class, then do a static_cast to the version corresponding
to SkCanvasState::version.

Remove CANVAS_STATE_VERSION, which is redundant with the version
specified by the subclass.

Use unambiguous type for rowBytes.

Build Android with SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG. This allows us
to run the full suite of CanvasState tests. It is also representative
of what will be used on Android by WebView.

Fix CanvasStateTest where it was broken inside ifdef'ed out code.

Use SkCanvas::getBaseLayerSize() instead of the deprecated
SkCanvas::getDeviceSize().

Update the comments in the header to be more clear. In particular,
an SkCanvasState can only be used to pass an SkCanvas' state to a
future version of Skia (or the same); not an older version.

NOTREECHECKS=true

BUG=b/15693384
R=reed@google.com, mtklein@google.com, djsollen@google.com

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/372003002
2014-07-15 12:34:26 -07:00
reed
f59eab2693 patch from issue 383923002
TBR=

Author: reed@google.com

Review URL: https://codereview.chromium.org/394603003
2014-07-14 14:39:15 -07:00
tfarina
6599258a99 Cleanup: Remove unused/unimplemented SkTextLayout.h.
Nobody uses it in Skia, Chromium and Blink. And it does not have any
implementation either.

BUG=None
TEST=make all
R=mtklein@google.com, reed@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/385323002
2014-07-14 12:32:47 -07:00
reed
3b72f79289 remove unused SkPixelRef constructor
TBR=

Author: reed@google.com

Review URL: https://codereview.chromium.org/390893002
2014-07-14 10:13:57 -07:00
reed
ed458688e2 remove SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE code
TBR=

Author: reed@google.com

Review URL: https://codereview.chromium.org/387313004
2014-07-14 09:21:31 -07:00
robertphillips
e8464994bb Make SkPictureShader and SkPictureImageFilter use const SkPictures
R=mtklein@google.com, reed@google.com
TBR=reed@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/390023002
2014-07-14 07:53:27 -07:00
scroggo
7e4b2b5027 Remove unused kImageIsOpaque_Flag.
This flag is never set or read. We now look at the alpha type to
determine opacity.

R=reed@google.com

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/385943003
2014-07-14 07:53:18 -07:00
piotaixr
cef04f8188 Deleted SkImage::newShaderClamp: not used, not implemented.
Implemented SkImage::newShader.

BUG=skia:2701, 344804
R=junov@chromium.org, reed@chromium.org, bsalomon@chromium.org, reed@google.com

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/345463009
2014-07-14 07:48:04 -07:00
Robert Phillips
cfaeec446d Remove Skia's use of the default SkPicture constructor and multi-clone
This cannot be landed until (Chrome: Switch to one-at-a-time SkPicture::clone interface - https://codereview.chromium.org/380323002/) has landed.

R=mtklein@google.com
TBR=reed@google.com

Review URL: https://codereview.chromium.org/388833003
2014-07-13 12:00:50 -04:00
robertphillips
dd528967fc Remove SkPicture copy constructor
Given where we're heading with SkPicture why would you need to make a copy?

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

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/381133002
2014-07-13 07:55:53 -07:00
reed
b184f7f52b Add SkBitmap::readPixels() and reimplement copyTo and SkCanvas::readPixels
This reverts commit 651eaeadeb.

TBR=

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/390693002
2014-07-13 04:32:32 -07:00
reed
651eaeadeb Revert of Add SkBitmap::readPixels() and reimplement copyTo and SkCanvas::readPixels (https://codereview.chromium.org/388803007/)
Reason for revert:
still failing (randomly?) bench sometimes. need stack dump to diagnose.

Original issue's description:
> Add SkBitmap::readPixels() and reimplement copyTo and SkCanvas::readPixels
> usning it.
>
> Revert "Revert of add readPixels() to SkBitmap (https://codereview.chromium.org/377303002/)"
>
> This reverts commit d08cb905a7.
>
> TBR=scroggo@google.com
>
> Committed: https://skia.googlesource.com/skia/+/debba5c3d091159149f8a88ab5dcd44dd72e0dc7

R=reed@google.com
TBR=reed@google.com
NOTREECHECKS=true
NOTRY=true

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/382543005
2014-07-12 13:16:10 -07:00
reed
debba5c3d0 Add SkBitmap::readPixels() and reimplement copyTo and SkCanvas::readPixels
usning it.

Revert "Revert of add readPixels() to SkBitmap (https://codereview.chromium.org/377303002/)"

This reverts commit d08cb905a7.

R=reed@chromium.org
TBR=scroggo@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/388803007
2014-07-12 12:26:36 -07:00
jvanverth
733f5f5dbc Refactor SkGrFontScaler and SkGrFontKey into non-virtual versions.
This is a pre-cleanup for another change, but has the side benefit of making
the code simpler in general.

No perf increase, despite removing virtual functions.

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

Author: jvanverth@google.com

Review URL: https://codereview.chromium.org/385263002
2014-07-11 19:45:16 -07:00
caryclark
936b73424f ios fixes
skia_ios.mm
Get the app's Documents directory and pass use it to set the resource path.
This is a quick hack which will be replaced by a new application that is
a tiny shim around a command line tool.

SkImageEncoder.h
SkForceLinking.cpp
SkImageDecoder_CG.cpp
Add support for FORCE_LINKING so iOS sees the PNG encoder and others.

SkFloatBits.cpp
SkPoint.cpp
Handle denormalized numbers that are floored by the iOS ARM processor.

SkImageDecoder_iOS.mm
Remove empty encoder factory.

SkTouchGesture.cpp
Return early on empty state on touch rather than aborting (crashing)

JpegTest.cpp
Hal via stackoverflow.com says partial jpegs can be gray as well.

skia_test.cpp
Remove crash handler call for now to avoid link failure.

OverwriteLine.h
Remove fancy line overwrite for iOS.

Resources.cpp
Add interface to set resource directory based on runtime query.

BUG=skia:2736 skia:2737 skia:2738
R=reed@google.com, halcanary@google.com, mtklein@google.com, tfarina@chromium.org

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/373383003
2014-07-11 12:14:51 -07:00
scroggo
ef0fd61dc2 Remove SK_SUPPORT_LEGACY_SHADER_LOCALMATRIX.
This is no longer needed by Android.

BUG=skia:1976
R=reed@google.com

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/379323002
2014-07-11 11:33:52 -07:00
scroggo
c870d494dd Use SkShader's localMat for SkLocalMatrixShader.
Instead of setting SkShader::fLocalMatrix to Identity and storing
a separate SkMatrix inside SkLocalMatrixShader, reuse
SkShader::fLocalMatrix.

R=reed@google.com

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/386693003
2014-07-11 10:42:12 -07:00
bsalomon
848faf00ec This moves us towards variable length effect keys. The overall program key now allows for it. After the header it stores an array of offsets to effect keys. This allows us to grab the effect keys to pass to effects when they generate code. It also ensures that we can't get a collision by sets of keys that are different lengths but are the same when appended together.
R=robertphillips@google.com, jvanverth@google.com, egdaniel@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/356513003
2014-07-11 10:01:02 -07:00
bsalomon
00a8fae0ce Add support for 64bit atomic inc/dec/cas
R=mtklein@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/377073002
2014-07-11 08:42:11 -07:00
jcgregorio
d08cb905a7 Revert of add readPixels() to SkBitmap (https://codereview.chromium.org/377303002/)
Reason for revert:
Maybe causing crashes in bench.

http://108.170.220.120:10117/builders/Test-ChromeOS-Daisy-MaliT604-Arm7-Debug/builds/2608/steps/RunBench/logs/stdio

Original issue's description:
> add readPixels() to SkBitmap
>
> BUG=chromium:390782
>
> Committed: https://skia.googlesource.com/skia/+/c4f216151b6ade70c35fade09a353052f40236b1

R=scroggo@google.com, bsalomon@google.com, reed@google.com
TBR=bsalomon@google.com, reed@google.com, scroggo@google.com
NOTREECHECKS=true
NOTRY=true
BUG=chromium:390782

Author: jcgregorio@google.com

Review URL: https://codereview.chromium.org/382243003
2014-07-11 07:48:20 -07:00
robertphillips
ffc75efc1a Revert of Add alternate SkPicture::clone (https://codereview.chromium.org/381193002/)
Reason for revert:
Going to try to just remove the many-at-once clone interface

Original issue's description:
> Add alternate SkPicture::clone
>
> This adds an alternate version of SkPicture::clone for two reasons:
>
> 1) Chromium uses the SkPicture copy constructor to unpack the pictures from the old-style clone interface (and I would like to remove the copy ctor)
>
> 2) This is part of the long term plan to wean Chrome off of cloning. Once pictures are thread safe we will switch the new SkPicture::clone call to just return 'this'. From there it is a small step to removing clone entirely.
>
> Note that the two versions of clone() is temporary. Once this is landed (and rolled) I will land a Chrome-side patch to remove their use of the old interface (Use new SkPicture::clone interface - https://codereview.chromium.org/380323002/)
>
> Committed: https://skia.googlesource.com/skia/+/e372e78223a8ce916d276d6e0420d552fb0267e9

R=mtklein@google.com, reed@google.com
TBR=mtklein@google.com, reed@google.com
NOTREECHECKS=true
NOTRY=true

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/386933004
2014-07-11 06:45:58 -07:00
bungeman
bf0b9ced0b Add file access modes to sk_exists.
Both Windows and Posix 'access' calls take a mode parameter which,
in addition to checking existence, checks access modes.
This change exposes this functionality.

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

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/384903002
2014-07-10 15:18:23 -07:00