Commit Graph

3864 Commits

Author SHA1 Message Date
bsalomon
10805961ce Revert of Make the Sk GL context class an abstract base class (patchset #4 id:60001 of https://codereview.chromium.org/630843002/)
Reason for revert:
nanobech failing on Android

Original issue's description:
> Make the Sk GL context class an abstract base class
>
> Make the Sk GL context class, SkGLNativeContext, an abstract base class. Before,
> it depended on ifdefs to implement the platform dependent polymorphism.  Move
> the logic to subclasses of the various platform implementations.
>
> This a step to enable Skia embedders to compile dm and bench_pictures. The
> concrete goal is to support running these test apps with Chromium command buffer.
>
> With this change, Chromium can implement its own version of SkGLNativeContext
> that uses command buffer, and host the implementation in its own repository.
>
> Implements the above by renaming the SkGLContextHelper to SkGLContext and
> removing the unneeded SkGLNativeContext. Also removes
> SkGLNativeContext::AutoRestoreContext functionality, it appeared to be unused:
> no use in Skia code, and no tests.
>
> BUG=skia:2992
>
> Committed: https://skia.googlesource.com/skia/+/a90ed4e83897b45d6331ee4c54e1edd4054de9a8

TBR=kkinnunen@nvidia.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2992

Review URL: https://codereview.chromium.org/639793002
2014-10-08 04:45:10 -07:00
kkinnunen
a90ed4e838 Make the Sk GL context class an abstract base class
Make the Sk GL context class, SkGLNativeContext, an abstract base class. Before,
it depended on ifdefs to implement the platform dependent polymorphism.  Move
the logic to subclasses of the various platform implementations.

This a step to enable Skia embedders to compile dm and bench_pictures. The
concrete goal is to support running these test apps with Chromium command buffer.

With this change, Chromium can implement its own version of SkGLNativeContext
that uses command buffer, and host the implementation in its own repository.

Implements the above by renaming the SkGLContextHelper to SkGLContext and
removing the unneeded SkGLNativeContext. Also removes
SkGLNativeContext::AutoRestoreContext functionality, it appeared to be unused:
no use in Skia code, and no tests.

BUG=skia:2992

Review URL: https://codereview.chromium.org/630843002
2014-10-08 04:14:24 -07:00
joshualitt
47bb382830 Cleanup of shader building system
this is a huge refactor and cleanup of the gl shader building system in
Skia.  The entire shader building pipeline is now part of
GrGLProgramCreator, which takes a gp, and some fps, and creates a
program.  I added some subclasses of GrGLProgram to handle the
eccentricities of Nvpr/Nvpres.  Outside of the builders folder
and GrGLPrograms, this change is basically just a rename

solo gp

BUG=skia:

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

Review URL: https://codereview.chromium.org/611653002
2014-10-07 16:43:25 -07:00
joshualitt
db0d3ca070 Revert of Cleanup of shader building system (patchset #25 id:470001 of https://codereview.chromium.org/611653002/)
Reason for revert:
Seems to have messed up windows 7 gms

Original issue's description:
> Cleanup of shader building system
>
> this is a huge refactor and cleanup of the gl shader building system in
> Skia.  The entire shader building pipeline is now part of
> GrGLProgramCreator, which takes a gp, and some fps, and creates a
> program.  I added some subclasses of GrGLProgram to handle the
> eccentricities of Nvpr/Nvpres.  Outside of the builders folder
> and GrGLPrograms, this change is basically just a rename
>
>
> solo gp
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/fe1233c3f12f81bb675718516bbb32f72af726ec

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

Review URL: https://codereview.chromium.org/635533005
2014-10-07 12:42:26 -07:00
joshualitt
fe1233c3f1 Cleanup of shader building system
this is a huge refactor and cleanup of the gl shader building system in
Skia.  The entire shader building pipeline is now part of
GrGLProgramCreator, which takes a gp, and some fps, and creates a
program.  I added some subclasses of GrGLProgram to handle the
eccentricities of Nvpr/Nvpres.  Outside of the builders folder
and GrGLPrograms, this change is basically just a rename

solo gp

BUG=skia:

Review URL: https://codereview.chromium.org/611653002
2014-10-07 12:16:36 -07:00
Brian Salomon
9323b8b8e1 Revert "GrResourceCache2 manages scratch texture."
This reverts commit d14e1a2764.
2014-10-07 15:07:38 -04:00
mtklein
fb1fe4f518 Add SkPaint::getHash().
BUG=skia:

Review URL: https://codereview.chromium.org/637583002
2014-10-07 09:26:10 -07:00
joshualitt
d909759832 Revert of gl programs rewrite (patchset #10 id:180001 of https://codereview.chromium.org/628633003/)
Reason for revert:
breaks angle bot

Original issue's description:
> gl programs rewrite
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/07a255310aca9f3e83bf741dc663a58818ad681c

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

Review URL: https://codereview.chromium.org/631183003
2014-10-07 08:37:36 -07:00
joshualitt
07a255310a gl programs rewrite
BUG=skia:

Review URL: https://codereview.chromium.org/628633003
2014-10-07 08:05:21 -07:00
bsalomon
d14e1a2764 GrResourceCache2 manages scratch texture.
BUG=skia:2889

Review URL: https://codereview.chromium.org/608883003
2014-10-07 07:27:07 -07:00
bsalomon
f80bfedc42 GrContext::copyTexture->GrContext::copySurface.
Add a flush writes pixel ops flag.

Add an explicit flush writes for GrSurface.

BUG=skia:2977

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

Review URL: https://codereview.chromium.org/622663002
2014-10-07 05:56:02 -07:00
reed
4302ae91b0 add surfaceprops to SkWindow, and 'D' to toggle distancefieldfonts
BUG=skia:

Review URL: https://codereview.chromium.org/631943002
2014-10-06 12:29:56 -07:00
reed
9e96aa07db remove unused TextBufferDirection enum
BUG=skia:

Review URL: https://codereview.chromium.org/621403002
2014-10-03 12:44:37 -07:00
egdaniel
1a8ecdfb73 Add isSingleComponent bool to getConstantColorComponent
Initial step to allowing effects to use/output 1 or 4 color/coverage components. This cl doesn't change any current logic and all effects still assume they are working with 4 components.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/3b8af078281a5a20f951b9fd84f38d92b8f6217b

Review URL: https://codereview.chromium.org/608253002
2014-10-03 06:24:12 -07:00
bsalomon
d012877a6d Fix ref cnt'ing issue in GrProgramElement.
Drop ref on GrGpuResources when GrProgramElement loses its last ref and already has a pending execution.

BUG=skia:2889

Review URL: https://codereview.chromium.org/612293003
2014-10-03 05:31:41 -07:00
reed
2cc22b8f2f make SkMatrix::dump always available
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/624783002
2014-10-02 17:52:03 -07:00
reed
d1f0ebd0e2 specialize setConcat for scale+translate
This reverts commit 2a382f5199.

BUG=skia:

Review URL: https://codereview.chromium.org/626583002
2014-10-02 12:58:43 -07:00
robertphillips
b4b7a4c9ea Revert of Add isSingleComponent bool to getConstantColorComponent (patchset #6 id:100001 of https://codereview.chromium.org/608253002/)
Reason for revert:
Changing some GMs

Original issue's description:
> Add isSingleComponent bool to getConstantColorComponent
>
> Initial step to allowing effects to use/output 1 or 4 color/coverage components. This cl doesn't change any current logic and all effects still assume they are working with 4 components.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/3b8af078281a5a20f951b9fd84f38d92b8f6217b

TBR=joshualitt@chromium.org,bsalomon@google.com,reed@google.com,egdaniel@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/617853003
2014-10-02 12:12:48 -07:00
bsalomon
85d3427d49 Revert of GrContext::copyTexture->GrContext::copySurface. Add a flush writes pixel ops flag. (patchset #3 id:40001 of https://codereview.chromium.org/622663002/)
Reason for revert:
Breaking GMs on some bots

Original issue's description:
> GrContext::copyTexture->GrContext::copySurface.
>
> Add a flush writes pixel ops flag.
>
> Add an explicit flush writes for GrSurface.
>
> BUG=skia:2977
>
> Committed: https://skia.googlesource.com/skia/+/cf99b00980b6c9c557e71abf1a7c9f9b21217262

TBR=robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2977

Review URL: https://codereview.chromium.org/621073002
2014-10-02 11:23:04 -07:00
bsalomon
cf99b00980 GrContext::copyTexture->GrContext::copySurface.
Add a flush writes pixel ops flag.

Add an explicit flush writes for GrSurface.

BUG=skia:2977

Review URL: https://codereview.chromium.org/622663002
2014-10-02 10:42:24 -07:00
egdaniel
3b8af07828 Add isSingleComponent bool to getConstantColorComponent
Initial step to allowing effects to use/output 1 or 4 color/coverage components. This cl doesn't change any current logic and all effects still assume they are working with 4 components.

BUG=skia:

Review URL: https://codereview.chromium.org/608253002
2014-10-02 09:57:48 -07:00
robertphillips
2a382f5199 Revert of specialize setConcat for scale+translate (patchset #1 id:1 of https://codereview.chromium.org/620433002/)
Reason for revert:
Experimental to see if this revert "fixes" nanobench on the main console.

Original issue's description:
> specialize setConcat for scale+translate, helps drawText perf
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/e8db3ef2a2161084fa8eb1fd1d54c35bfff52d6c

TBR=jvanverth@google.com,reed@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/620973003
2014-10-02 04:42:55 -07:00
derekf
29dda80c01 Add support for EGL on linux
Allow setting skia_egl=1 to build skia against EGL instead of GLX on unix

Review URL: https://codereview.chromium.org/604853003
2014-10-01 10:52:52 -07:00
mtklein
8e12656096 Remove DEPRECATED_beginRecording().
This removes:
  1) ability to record old pictures with SkPictureRecorder;
  2) a couple tests specific to the old backend.

The functionality of DEPRECATED_beginRecording() now lives in
(private) SkPicture::Backport(), which is the only place we
need it now.

BUG=skia:
TBR=reed@google.com

Review URL: https://codereview.chromium.org/618303002
2014-10-01 09:29:35 -07:00
reed
10d0327c16 add SkRect::joinNonEmptyArg for faster unioning
BUG=skia:

Review URL: https://codereview.chromium.org/619853005
2014-10-01 09:24:12 -07:00
robertphillips
68cd2aa797 Update GrRecordReplaceDraw to use SkTDynamicHash & add ReplaceDraw
Having hoisted layers from different pictures invalidates the assumptions of the old GrReplacements object. This is fixed by switching to a SkTDynamicHash-based back-end.

Sub-picture-layers also require that the replacement drawing occur for the sub-pictures too. The ReplaceDraw object is added to make this happen and limit the replacement lookup to saveLayer draw commands.

This is split out of (Fix sub-picture layer rendering bugs - https://codereview.chromium.org/597293002/).

BUG=skia:2315

Review URL: https://codereview.chromium.org/607763008
2014-10-01 09:24:06 -07:00
reed
d9c42f71c3 optimize setRectFan and join -- from profiling drawText
BUG=skia:
NOTREECHECKS=True
NOTRY=True

Review URL: https://codereview.chromium.org/615993003
2014-10-01 07:21:23 -07:00
mtklein
f6fde175b8 Archive more dead code.
BUG=skia:
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

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

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

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

BUG=skia:

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/617953002
2014-09-30 14:47:10 -07:00
bsalomon
afbf2d6273 Make "priv" classes for GrTexure and GrSurface.
R=robertphillips@google.com, egdaniel@google.com, joshualitt@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/596053002
2014-09-30 12:18:44 -07:00
mtklein
8de02f4bf3 Clean up SK_PICTURE_USE_SK_RECORD and SK_PICTURE_OPTIMIZE_SK_RECORD.
This folds the code through as if they were defined, which is the explicit
state in both our build and Chrome's.

This leaves the EXPERIMENTAL_ and DEPRECATED_ hooks in to be cleaned up or
privatized later.

CQ_EXTRA_TRYBOTS=tryserver.skia:Canary-Chrome-Ubuntu13.10-Ninja-x86_64-ToT-Trybot

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/616033002
2014-09-30 11:43:53 -07:00
mtklein
5bc760a6a6 Remove support for SkPicture::clone().
This folds SK_SUPPORT_LEGACY_PICTURE_CLONE through as undefined.

Chrome's not used clone() for a month or two, and we don't use it ourselves.
Don't think Android ever did.

CQ_EXTRA_TRYBOTS=tryserver.skia:Canary-Chrome-Ubuntu13.10-Ninja-x86_64-ToT-Trybot

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/620533002
2014-09-30 11:14:38 -07:00
reed
7874dc8e71 remove obsolete code for SK_SUPPORT_LEGACY_IMAGEGENERATORAPI
BUG=skia:
R=reed@google.com

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/613933002
2014-09-30 10:15:32 -07:00
reed
e8db3ef2a2 specialize setConcat for scale+translate, helps drawText perf
BUG=skia:
R=jvanverth@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/620433002
2014-09-30 07:24:47 -07:00
robertphillips
b06e5a2f55 Revert of Make "priv" classes for GrTexure and GrSurface. (patchset #9 id:260001 of https://codereview.chromium.org/596053002/)
Reason for revert:
Breaking the Chrome builds with:

 lib/libcc.so: error: undefined reference to 'GrAutoScratchTexture::detach()'

(http://108.170.220.120:10117/builders/Canary-Chrome-Ubuntu13.10-Ninja-x86_64-DRT/builds/2990/steps/Retry_BuildContentShell_1/logs/stdio)

Original issue's description:
> Make "priv" classes for GrTexure and GrSurface.

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

Author: robertphillips@google.com

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

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

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

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

Author: robertphillips@google.com

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

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/608883003
2014-09-30 06:02:23 -07:00
bsalomon
c0eb9b9818 Make "priv" classes for GrTexure and GrSurface.
R=robertphillips@google.com, egdaniel@google.com, joshualitt@google.com, joshualitt@chromium.org

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/596053002
2014-09-29 14:20:11 -07:00
reed
c5e15a1afa remove alphatype from colortable
the owning bitmap is (already) responsible for knowing the alphatype

BUG=skia:
R=djsollen@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/611093002
2014-09-29 12:10:27 -07:00
piotaixr
b7bac3d015 Override drawImage*() in SkNWayCanvas
BUG=skia:2947
R=junov@chromium.org, reed@google.com, bsalomon@chromium.org

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/600643002
2014-09-29 08:56:19 -07:00
senorblanco
3a49520696 Sanitize SkMatrixConvolutionImageFilter creation params.
Apply the same memory limit in the Create() function that we do when
deserializing.

R=reed@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/610723002
2014-09-29 07:57:20 -07:00
fmalita
05c4a4322e Revert of Revert of Fix SkTextBlob offset semantics. (patchset #1 id:1 of https://codereview.chromium.org/609223003/)
Reason for revert:
Re-landing: Chromium-side fix to be landed with the roll (https://codereview.chromium.org/607853003/)

Original issue's description:
> Revert of Fix SkTextBlob offset semantics. (patchset #2 id:20001 of https://codereview.chromium.org/605533002/)
>
> Reason for revert:
> Breaking the Chrome builds with the error:
>
> [14:54:14.317833] ../../skia/ext/pixel_ref_utils.cc:221:16: error: 'drawPosText' marked 'override' but does not override any member functions
> [14:54:14.318022]   virtual void drawPosText(const SkDraw& draw,
> [14:54:14.318082]                ^
>
> Original issue's description:
> > Fix SkTextBlob offset semantics.
> >
> > Implement proper x/y drawTextBlob() handling by plumbing a
> > drawPosText() offset parameter (to act as an additional glyph pos
> > translation) throughout the device layer.
> >
> > The new offset superceeds the existing constY, with a minor semantic
> > tweak: whereas previous implementations were ignoring constY in 2D
> > positioning mode (scalarsPerGlyph == 2), now the offset is always
> > observed, in all positioning modes. We can do this because existing
> > drawPosText() clients always pass constY == 0 for full positioning mode.
> >
> > R=reed@google.com, jvanverth@google.com, robertphillips@google.com
> >
> > Committed: https://skia.googlesource.com/skia/+/c13bc571d3e61a43b87eb97f0719abd304cafaf2
>
> TBR=jvanverth@google.com,reed@google.com,bsalomon@google.com,fmalita@chromium.org
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/d46b8d2bab7cfba8458432248e1568ac377429e9

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

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/607413003
2014-09-29 06:29:53 -07:00
robertphillips
ee6631ef90 Update RecordReplaceDrawTest to generate and pass pictures
This CL splits the unit test changes out of (Fix sub-picture layer rendering bugs - https://codereview.chromium.org/597293002/).

For various reasons GrRecordReplaceDraw now needs to take an SkPicture (rather than an SkRecord and a BBH).

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

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/608823002
2014-09-29 05:32:50 -07:00
robertphillips
d46b8d2bab Revert of Fix SkTextBlob offset semantics. (patchset #2 id:20001 of https://codereview.chromium.org/605533002/)
Reason for revert:
Breaking the Chrome builds with the error:

[14:54:14.317833] ../../skia/ext/pixel_ref_utils.cc:221:16: error: 'drawPosText' marked 'override' but does not override any member functions
[14:54:14.318022]   virtual void drawPosText(const SkDraw& draw,
[14:54:14.318082]                ^

Original issue's description:
> Fix SkTextBlob offset semantics.
>
> Implement proper x/y drawTextBlob() handling by plumbing a
> drawPosText() offset parameter (to act as an additional glyph pos
> translation) throughout the device layer.
>
> The new offset superceeds the existing constY, with a minor semantic
> tweak: whereas previous implementations were ignoring constY in 2D
> positioning mode (scalarsPerGlyph == 2), now the offset is always
> observed, in all positioning modes. We can do this because existing
> drawPosText() clients always pass constY == 0 for full positioning mode.
>
> R=reed@google.com, jvanverth@google.com, robertphillips@google.com
>
> Committed: https://skia.googlesource.com/skia/+/c13bc571d3e61a43b87eb97f0719abd304cafaf2

R=jvanverth@google.com, reed@google.com, bsalomon@google.com, fmalita@chromium.org
TBR=bsalomon@google.com, fmalita@chromium.org, jvanverth@google.com, reed@google.com
NOTREECHECKS=true
NOTRY=true

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/609223003
2014-09-29 04:48:52 -07:00
tomhudson
faccb8eb53 SkMatrix44::preserves2dAxisAlignment()
Convenience function requested for Chrome compositor that may have a performance
advantage.

BUG=skia:1017
R=reed@google.com, danakj@chromium.org, vollick@chromium.org

Author: tomhudson@google.com

Review URL: https://codereview.chromium.org/508303005
2014-09-26 11:45:48 -07:00
piotaixr
5ceff913cf Rename SkImage::draw(_, SkRect, SkRect) in SkImage::drawRect()
BUG=skia:2947
R=reed@google.com, junov@chromium.org

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/605843002
2014-09-26 07:36:26 -07:00
Florin Malita
c13bc571d3 Fix SkTextBlob offset semantics.
Implement proper x/y drawTextBlob() handling by plumbing a
drawPosText() offset parameter (to act as an additional glyph pos
translation) throughout the device layer.

The new offset superceeds the existing constY, with a minor semantic
tweak: whereas previous implementations were ignoring constY in 2D
positioning mode (scalarsPerGlyph == 2), now the offset is always
observed, in all positioning modes. We can do this because existing
drawPosText() clients always pass constY == 0 for full positioning mode.

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

Review URL: https://codereview.chromium.org/605533002
2014-09-26 10:33:37 -04:00
egdaniel
89af44a0f1 Split GrDrawState and GrOptDrawState into separate classes and remove base class.
Besides splitting the two classes, there are no logical changes here and mostly moving code around.

BUG=skia:
R=bsalomon@google.com

Author: egdaniel@google.com

Review URL: https://codereview.chromium.org/597323002
2014-09-26 06:15:04 -07:00
piotaixr
d52893cfc8 Add doc on SkCanvas::drawImage*() methods
BUG=skia:2947
R=junov@chromium.org, reed@google.com

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/595043002
2014-09-25 14:39:40 -07:00
piotaixr
90a36e5feb Make SkImage::draw() private
BUG=skia:2947
R=junov@chromium.org, reed@google.com, bsalomon@chromium.org

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/608623002
2014-09-25 14:30:57 -07:00
mtklein
610a015fda Remove SkPaint dirty bits.
fDirtyBits is only used by SkPaint::FlatteningTraits, which in turn was
only used as a smaller, faster format to flatten paints in-memory to dedup
them in the old picture backend.

SkRecord obsoleted all this.  Neither flatten()/unflatten() (disk format)
nor FlatteningTraits is used anywhere performance or size matters.

Here I revert the deduping code back to using the disk format for flattened paints.
We stil do have to flatten and unflatten paints while coverting from SkRecord
backend to the old backend, so we can't just delete this all yet, but any
faithful round trip flatten()/unflatten() pair will be fine, however slow.

NOTRY=true

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/604813003
2014-09-25 11:57:53 -07:00
piotaixr
b5fae93d72 SkCanvas::drawImage is the new way for drawing a SkImage to a Canvas
BUG=skia:2947

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

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

Author: piotaixr@chromium.org

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

Reverting to unblock DEPS roll.

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

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

Author: borenet@google.com

Review URL: https://codereview.chromium.org/598133002
2014-09-24 11:03:35 -07:00
borenet
e33985a56d Revert "Add support for EGL on linux"
This reverts commit 1cea736c32.

Caused segfaults on all Android devices

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

Author: borenet@google.com

Review URL: https://codereview.chromium.org/599493003
2014-09-24 05:31:07 -07:00
derekf
1cea736c32 Add support for EGL on linux
Allow setting skia_egl=1 to build skia against EGL instead of GLX on unix

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

Author: derekf@osg.samsung.com

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

Author: piotaixr@chromium.org

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

BUG=skia:
R=bsalomon@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/582963002
2014-09-23 09:50:21 -07:00
junov
f23809101e Adding support for GL_CHROMIUM_copy_texture, part 1
Part 1 of 2. This change just adds the gl API entrypoint
so that the chromium/ganesh bindings can set it. Once
the chromium part is landed, we will add full support for
the extension

BUG=crbug.com/415100
R=bsalomon@google.com

Author: junov@chromium.org

Review URL: https://codereview.chromium.org/594663002
2014-09-23 07:30:09 -07:00
bsalomon
8d034a154f Don't flush on read/write pixels unless necessary
BUG=skia:2889

Committed: https://skia.googlesource.com/skia/+/150723b9298772a5096bec7acd2999c5c9d66239

R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/586073002
2014-09-22 12:21:08 -07:00
bsalomon
4401a1f7d6 Revert of Don't flush on read/write pixels unless necessary (patchset #2 id:20001 of https://codereview.chromium.org/586073002/)
Reason for revert:
Breaking the tree

Original issue's description:
> Don't flush on read/write pixels unless necessary
>
> BUG=skia:2889
>
> Committed: https://skia.googlesource.com/skia/+/150723b9298772a5096bec7acd2999c5c9d66239

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

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/594543004
2014-09-22 09:12:11 -07:00
bsalomon
150723b929 Don't flush on read/write pixels unless necessary
BUG=skia:2889
R=robertphillips@google.com

Author: bsalomon@google.com

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

TBR=

Author: reed@google.com

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

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

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

Author: reed@chromium.org

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/551463004
2014-09-21 09:39:55 -07:00
fmalita
3c196def91 Souped-up SkTextBlob.
Refactored text blob backend for improved performance: instead of using
separate buffers for runs/positions/glyphs, everything is now packed in
a consolidated slab (including the SkTextBlob object itself!).

Benefits:

 * number of allocations per blob construction reduced from ~4 to 1
   (also minimizes internal fragmentation)
 * run record size reduced by 8 bytes

This takes the blob construction overhead down to negligible levels
(for the current Blink uncached textblob implementation).

Unfortunately, the code is much more finicky (run merging in
particular) -- hence the assert spree.

Multi-run blobs are vulnerable to realloc storms but this is not a
problem at the moment because Blink is using one-run blobs 99% of the
time. Will be addressed in the future.

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

Committed: https://skia.googlesource.com/skia/+/13645ea0ea87038ebd71be3bd6d53b313069a9e4

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/581173003
2014-09-20 05:40:22 -07:00
fmalita
e50215e598 Revert of Souped-up SkTextBlob. (patchset #3 id:40001 of https://codereview.chromium.org/581173003/)
Reason for revert:
Broke the new blobshader gm.

Original issue's description:
> Souped-up SkTextBlob.
>
> Refactored text blob backend for improved performance: instead of using
> separate buffers for runs/positions/glyphs, everything is now packed in
> a consolidated slab (including the SkTextBlob object itself!).
>
> Benefits:
>
>  * number of allocations per blob construction reduced from ~4 to 1
>    (also minimizes internal fragmentation)
>  * run record size reduced by 8 bytes
>
> This takes the blob construction overhead down to negligible levels
> (for the current Blink uncached textblob implementation).
>
> Unfortunately, the code is much more finicky (run merging in
> particular) -- hence the assert spree.
>
> Multi-run blobs are vulnerable to realloc storms but this is not a
> problem at the moment because Blink is using one-run blobs 99% of the
> time. Will be addressed in the future.
>
>
> R=reed@google.com,mtklein@google.com,robertphillips@google.com
>
> Committed: https://skia.googlesource.com/skia/+/13645ea0ea87038ebd71be3bd6d53b313069a9e4

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

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/588853002
2014-09-19 19:03:06 -07:00
fmalita
13645ea0ea Souped-up SkTextBlob.
Refactored text blob backend for improved performance: instead of using
separate buffers for runs/positions/glyphs, everything is now packed in
a consolidated slab (including the SkTextBlob object itself!).

Benefits:

 * number of allocations per blob construction reduced from ~4 to 1
   (also minimizes internal fragmentation)
 * run record size reduced by 8 bytes

This takes the blob construction overhead down to negligible levels
(for the current Blink uncached textblob implementation).

Unfortunately, the code is much more finicky (run merging in
particular) -- hence the assert spree.

Multi-run blobs are vulnerable to realloc storms but this is not a
problem at the moment because Blink is using one-run blobs 99% of the
time. Will be addressed in the future.

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

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/581173003
2014-09-19 18:37:00 -07:00
piotaixr
d49226cff3 Get rid of SkImage_Codec
Use SkImage_Raster with an ImageGenerator instead.

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

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/589713002
2014-09-19 13:30:06 -07:00
bsalomon
45725db1d8 Move IOType to GrGpuRef and rename that to GrIORef. Template GrPendingIORef on IOType.
BUG=skia:2889
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/579403003
2014-09-19 11:48:02 -07:00
bsalomon
b3e3a955b6 Make GrIODB keep pending IO refs on all resources it records into its cmd stream.
BUG=skia:2889
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/581123002
2014-09-19 11:10:40 -07:00
reed
65b48952d7 remove RenderTargetFlags -- NewRenderTargetDirect will never clear
BUG=skia:
R=robertphillips@google.com, bsalomon@google.com

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/583043002
2014-09-19 05:56:29 -07:00
robertphillips
754f4e98d9 Add counting of some GL calls
I would like this facility for tracking FBO switch improvements.

R=bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/553583008
2014-09-18 13:52:08 -07:00
cdalton
855d83ff79 Uses a single pre-baked set of paths for drawing nvpr text of a given
typeface. Loads the paths using the driver's glyph loading routines.

Refactors GrPathRange to accept a PathGenerator class that it uses to
lazily initialize its paths. The client code is no longer expected to
initialize the paths in a GrPathRange; instead it must provide a
PathGenerator* instance to createPathRange().

Adds a new createGlyphs() method to GrPathRendering that creates a
range of glyph paths, indexed by glyph id. GrPathRendering implements
createGlyphs() with a PathGenerator that loads glyph paths using the
skia frameworks. GrGLPathRendering uses glMemoryGlyphIndexArrayNV()
instead, when possible, to load the glyph paths.

Removes all GlyphPathRange logic from GrStencilAndCoverTextContext.
It instead uses createGlyphs().

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

Author: cdalton@nvidia.com

Review URL: https://codereview.chromium.org/563283004
2014-09-18 13:51:53 -07:00
joshualitt
23e280d1f2 Changes to remove program effects builder
BUG=skia:
R=bsalomon@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/551253004
2014-09-18 12:26:38 -07:00
reed
0397e9f341 use surface in SkView/SampleApp
BUG=skia:
R=bsalomon@google.com, robertphillips@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/580073003
2014-09-18 11:29:01 -07:00
caryclark
a10742c69c update to accommodate latest clang in chrome toolchain
remove asserts for null pointers to references
change var args signature to pointer instead of array

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

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/577243002
2014-09-18 11:00:40 -07:00
bungeman
d71b757573 Serialize the font index.
BUG=skia:1186
R=reed@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/567013002
2014-09-18 10:55:32 -07:00
bungeman
ef59adba5b Clarify build test for presense of 'float copysign(float, float)'.
Clang-cl reports __cplusplus based on the version of clang instead of
reporting the __cplusplus the vc++ version _MSC_VER would.
This is important as the _MSC_VER also indicates which vc++ runtime
library will be used. As a result, do not trust the __cplusplus version
reported by clang-cl.

This change clarifies the intent of
https://skia.googlesource.com/skia/+/c34b0d4e9ad5806c1f882a1f85191f2ea8ddcdba

R=reed@google.com

Author: bungeman@google.com

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/577023002
2014-09-17 10:49:38 -07:00
cdalton
4e205b1079 Remove createPath* from GrGpu and GrContext
Now that we have the GrPathRendering class, it doesn't make sense to
have a bunch of shims on on GrGpu. This updates the path rendering
clients to make calls directly on the GrPathRendering object.

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

Author: cdalton@nvidia.com

Review URL: https://codereview.chromium.org/578563002
2014-09-17 09:41:24 -07:00
cdalton
149b3ec2b1 Adds glMemoryGlyphIndexArrayNV to the GrGLInterface and begins
detecting support for this method in GrGLPathRendering.

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

Author: cdalton@nvidia.com

Review URL: https://codereview.chromium.org/570733002
2014-09-17 09:19:18 -07:00
bsalomon
f96ba02513 Rename GrProgramResource to GrGpuResourceRef
BUG=skia:2889
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/574333003
2014-09-17 08:05:40 -07:00
bungeman
b374d6a62c Add onGetFamilyName to SkTypeface.
This speeds up and documents this particular feature of SkTypeface
and also frees up SkFontDescriptor to be used only in serialization.

R=reed@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/574873002
2014-09-17 07:48:59 -07:00
bsalomon
3850971d54 Revert "Revert "Move SkGpuDevice.h to src/gpu""
This reverts commit b0a35f7c5d.

R=borenet@google.com
TBR=borenet@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/575783003
2014-09-17 07:44:25 -07:00
borenet
b0a35f7c5d Revert "Move SkGpuDevice.h to src/gpu"
This reverts commit d99bbb61e5.

Causing Chrome canary failures as well as failures of Chrome trybots due to
not cleaning up properly after failed DEPS roll attempts.

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

Author: borenet@google.com

Review URL: https://codereview.chromium.org/579733003
2014-09-17 06:14:35 -07:00
bsalomon
d99bbb61e5 Move SkGpuDevice.h to src/gpu
R=reed@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/545193006
2014-09-16 14:09:13 -07:00
bsalomon
c49233410e Make templated GrProgramTResource subclass of GrProgramResource
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/563963004
2014-09-16 13:54:53 -07:00
reed
3375c8047e when we disable lcd for impl reasons, add kGenA8 to document the original intent
BUG=skia:
R=bungeman@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/572933004
2014-09-16 12:27:55 -07:00
tomhudson
a32f1758b7 Add helper SkMatrix44::hasPerspective()
BUG=skia:1017
R=danakj@chromium.org, reed@google.com

Author: tomhudson@google.com

Review URL: https://codereview.chromium.org/513343002
2014-09-16 08:29:29 -07:00
joshualitt
49586bec73 removing GrDrawEffect
BUG=skia:

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

R=bsalomon@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/571163002
2014-09-16 08:21:42 -07:00
joshualitt
08da4f22d7 Revert of removing GrDrawEffect (patchset #4 id:60001 of https://codereview.chromium.org/571163002/)
Reason for revert:
reverting to unblock another revert

Original issue's description:
> removing GrDrawEffect
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/8ddbe8b9366c8c59c4fb55f01f253de8a0b37d6e

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

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/577593003
2014-09-16 07:17:28 -07:00
joshualitt
8ddbe8b936 removing GrDrawEffect
BUG=skia:
R=bsalomon@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/571163002
2014-09-16 06:46:30 -07:00
yunchao.he
49005bf892 Picture Recording: fix the performance bottleneck in SkDeferredCanvas::isFullFrame
blink skips all pending commands during picture recording if it is drawing an opaque full-frame
geometry or image. This may improve performance for some edge cases. To recognize an opaque
full-frame drawing should be cheap enough. Otherwise, the overhead will offset the improvement.
Unfortunately, data from perf for content_shell on Nexus7 shows that SkDeferredCanvas::isFullFrame
is far from cheap. Table below shows that how much isFullFrame() costs in the whole render process.

benchmark                              percentage
my local benchmark(draw 1000 sprites)   4.1%
speedReading                            2.8%
FishIETank(1000 fishes)                 1.5%
GUIMark3 Bitmap                         2.0%

By contrast, real recording (SkGPipeCanvas::drawBitmapRectToRect) and real rasterization
(GrDrawTarget::drawRect) cost ~4% and ~6% in the whole render process respectively. Apparently,
SkDeferredCanvas::isFullFrame() is nontrivial.

getDeviceSize() is the main contributor to this hotspot. The change simply save the canvasSize and
reuse it among drawings if it is not a fresh frame. This change cut off ~65% (or improved ~2 times)
of isFullFrame().

telemetry smoothness canvas_tough_test didn't show obvious improvement or regression.

BUG=411166

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

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

Author: yunchao.he@intel.com

Review URL: https://codereview.chromium.org/545813002
2014-09-15 22:30:38 -07:00
joshualitt
249af15fb8 BUG=skia:
R=bsalomon@google.com, egdaniel@google.com, jvanverth@google.com, robertphillips@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/543623004
2014-09-15 11:41:14 -07:00
caryclark
e956259c5a add dumpHex() option to SkPath
This provides exact precision
to help debugging when the float
representation of a SkScalar may
introduce error.

R=reed@google.com

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/571973003
2014-09-15 09:26:09 -07:00
mtklein
5087b2c067 Revert of Picture Recording: fix the performance bottleneck in SkDeferredCanvas::isFullFrame (patchset #7 id:140001 of https://codereview.chromium.org/545813002/)
Reason for revert:
This is leaking memory:

http://108.170.220.120:10117/builders/Test-Ubuntu13.10-GCE-NoGPU-x86_64-Debug-ASAN/builds/2516/steps/RunDM/logs/stdio

Original issue's description:
> Picture Recording: fix the performance bottleneck in SkDeferredCanvas::isFullFrame
>
> blink skips all pending commands during picture recording if it is drawing an opaque full-frame
> geometry or image. This may improve performance for some edge cases. To recognize an opaque
> full-frame drawing should be cheap enough. Otherwise, the overhead will offset the improvement.
> Unfortunately, data from perf for content_shell on Nexus7 shows that SkDeferredCanvas::isFullFrame
> is far from cheap. Table below shows that how much isFullFrame() costs in the whole render process.
>
> benchmark                              percentage
> my local benchmark(draw 1000 sprites)   4.1%
> speedReading                            2.8%
> FishIETank(1000 fishes)                 1.5%
> GUIMark3 Bitmap                         2.0%
>
> By contrast, real recording (SkGPipeCanvas::drawBitmapRectToRect) and real rasterization
> (GrDrawTarget::drawRect) cost ~4% and ~6% in the whole render process respectively. Apparently,
> SkDeferredCanvas::isFullFrame() is nontrivial.
>
> getDeviceSize() is the main contributor to this hotspot. The change simply save the canvasSize and
> reuse it among drawings if it is not a fresh frame. This change cut off ~65% (or improved ~2 times)
> of isFullFrame().
>
> telemetry smoothness canvas_tough_test didn't show obvious improvement or regression.
>
> BUG=411166
>
> Committed: https://skia.googlesource.com/skia/+/8e45c3777d886ba3fe239bb549d06b0693692152

R=junov@chromium.org, tomhudson@google.com, reed@google.com, yunchao.he@intel.com
TBR=junov@chromium.org, reed@google.com, tomhudson@google.com, yunchao.he@intel.com
NOTREECHECKS=true
NOTRY=true
BUG=411166

Author: mtklein@google.com

Review URL: https://codereview.chromium.org/571053002
2014-09-15 06:00:49 -07:00
yunchao.he
8e45c3777d Picture Recording: fix the performance bottleneck in SkDeferredCanvas::isFullFrame
blink skips all pending commands during picture recording if it is drawing an opaque full-frame
geometry or image. This may improve performance for some edge cases. To recognize an opaque
full-frame drawing should be cheap enough. Otherwise, the overhead will offset the improvement.
Unfortunately, data from perf for content_shell on Nexus7 shows that SkDeferredCanvas::isFullFrame
is far from cheap. Table below shows that how much isFullFrame() costs in the whole render process.

benchmark                              percentage
my local benchmark(draw 1000 sprites)   4.1%
speedReading                            2.8%
FishIETank(1000 fishes)                 1.5%
GUIMark3 Bitmap                         2.0%

By contrast, real recording (SkGPipeCanvas::drawBitmapRectToRect) and real rasterization
(GrDrawTarget::drawRect) cost ~4% and ~6% in the whole render process respectively. Apparently,
SkDeferredCanvas::isFullFrame() is nontrivial.

getDeviceSize() is the main contributor to this hotspot. The change simply save the canvasSize and
reuse it among drawings if it is not a fresh frame. This change cut off ~65% (or improved ~2 times)
of isFullFrame().

telemetry smoothness canvas_tough_test didn't show obvious improvement or regression.

BUG=411166
R=junov@chromium.org, tomhudson@google.com, reed@google.com

Author: yunchao.he@intel.com

Review URL: https://codereview.chromium.org/545813002
2014-09-14 18:59:04 -07:00
rileya
abaef86f2b Add support for the Rec601 YUV color space to GrYUVtoRGBEffect.
R=bsalomon@google.com, senorblanco@chromium.org, sugoi@chromium.org, reed@google.com

Author: rileya@chromium.org

Review URL: https://codereview.chromium.org/516463005
2014-09-12 17:45:58 -07:00
ehsan.akhgari
c34b0d4e9a Do not expect a copysign function to be defined in <cmath> with clang-cl
clang-cl defines __cplusplus to 201103L, but it uses the runtime library
provided by MSVC, so the copysign function will not be available there.

BUG=skia:
R=reed@google.com

Author: ehsan.akhgari@gmail.com

Review URL: https://codereview.chromium.org/526813002
2014-09-12 12:30:35 -07:00
reed
9594da111d use SkData::NewUninitialized
BUG=skia:
R=bungeman@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/565803005
2014-09-12 12:12:27 -07:00
reed
83658305a1 remove confusing/unused stream methods
BUG=skia:
R=bungeman@google.com, djsollen@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/563273003
2014-09-12 08:49:54 -07:00
reed
56b00d9e7a add PurgeResourceCache to track leaks
TBR=halcananry

Author: reed@google.com

Review URL: https://codereview.chromium.org/554263005
2014-09-11 12:22:34 -07:00
reed
33a30503d7 SkData can allocate room for its contents in the same block
BUG=skia:
R=bungeman@google.com, mtklein@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/560653004
2014-09-11 08:42:36 -07:00
mtklein
aa90d00f14 Assert SkTDArray::pop() doesn't underflow.
BUG=skia:
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/563633003
2014-09-11 06:36:11 -07:00
bungeman
f91c47d91d Remove a layer of indirection and code from SkFontHost.
R=mtklein@google.com, tomhudson@google.com, djsollen@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/105223006
2014-09-10 15:49:48 -07:00
reed
cc0e3110bd make set3DMask virtual, so we can safely notify the shadercontext
also boost preallocated storage to account for this combo of bitmapshader + emboss + colorfilter

BUG=skia:
R=djsollen@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/563563002
2014-09-10 10:20:24 -07:00
reed
841010f4bd disable conservative rasterclip on gpu, until we understand perspective
BUG=skia:
R=bsalomon@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/561763002
2014-09-10 07:23:32 -07:00
reed
d954498c01 Revert of Revert of allow canvas to force conservative clips (for speed) (patchset #1 id:1 of https://codereview.chromium.org/554033003/)
Reason for revert:
May just rebaseline, plus want to see the results of the chrome tests, so re-trying this CL.

Original issue's description:
> Revert of allow canvas to force conservative clips (for speed) (patchset #7 id:120001 of https://codereview.chromium.org/541593005/)
>
> Reason for revert:
> multipicturedraw failed on nvprmsaa -- don't know why yet
>
> Original issue's description:
> > Allow SkCanvas to be initialized to force conservative rasterclips. This has the following effects:
> >
> > 1. Queries to the current clip will be conservatively large. This can mean the quickReject may return false more often.
> >
> > 2. The conservative clips mean less work is done.
> >
> > 3. Enabled by default for Gpu, Record, and NoSaveLayer canvases.
> >
> > 4. API is private for now.
> >
> > Committed: https://skia.googlesource.com/skia/+/27a5e656c3d6ef22f9cb34de18e1b960da3aa241
>
> TBR=robertphillips@google.com,bsalomon@google.com,mtklein@google.com,junov@google.com
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/6f09709519b79a1159f3826645f1c5fbc101ee11

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

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/560713002
2014-09-09 18:46:22 -07:00
reed
6f09709519 Revert of allow canvas to force conservative clips (for speed) (patchset #7 id:120001 of https://codereview.chromium.org/541593005/)
Reason for revert:
multipicturedraw failed on nvprmsaa -- don't know why yet

Original issue's description:
> Allow SkCanvas to be initialized to force conservative rasterclips. This has the following effects:
>
> 1. Queries to the current clip will be conservatively large. This can mean the quickReject may return false more often.
>
> 2. The conservative clips mean less work is done.
>
> 3. Enabled by default for Gpu, Record, and NoSaveLayer canvases.
>
> 4. API is private for now.
>
> Committed: https://skia.googlesource.com/skia/+/27a5e656c3d6ef22f9cb34de18e1b960da3aa241

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/554033003
2014-09-09 12:51:10 -07:00
reed
27a5e656c3 Allow SkCanvas to be initialized to force conservative rasterclips. This has the following effects:
1. Queries to the current clip will be conservatively large. This can mean the quickReject may return false more often.

2. The conservative clips mean less work is done.

3. Enabled by default for Gpu, Record, and NoSaveLayer canvases.

4. API is private for now.

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/541593005
2014-09-09 12:19:30 -07:00
bsalomon
655ad128d0 Make GrEffectStage copy constructor work correctly with pending execution refs.
R=egdaniel@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/551083002
2014-09-08 12:06:20 -07:00
bsalomon
18444b1649 Remove debug-only ref of GrEffectStage
BUG=skia:2889
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/553973002
2014-09-08 10:45:58 -07:00
bsalomon
2a9ca782ba Make GrDrawState and GrEffectStage use the pending io/exec ref mechanisms.
BUG=skia:2889
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/542723004
2014-09-05 14:27:43 -07:00
bsalomon
49f085dddf "NULL !=" = NULL
R=reed@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/544233002
2014-09-05 13:34:00 -07:00
bsalomon
52e9d63f71 Don't take a ref on GP in AutoEffectRestore.
BUG=skia:2889
R=joshualitt@chromium.org, robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/546043002
2014-09-05 12:23:12 -07:00
bsalomon
ac8d6193ea Add method to GrProgramResource to record that pending a execution was completed.
BUG=skia:2889
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/543833002
2014-09-04 14:13:44 -07:00
bsalomon
95740981c3 Add GrProgramElement base class for GrEffect with deferred exec ref.
BUG=skia:2889
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/537773004
2014-09-04 13:12:37 -07:00
reed
8f2e791baa add SK_API to forward declare in canvas.h
NOTRY=True
TBR=

Author: reed@google.com

Review URL: https://codereview.chromium.org/541073002
2014-09-04 12:45:18 -07:00
reed
fa35f8e6eb remove getTotalClipAsPath, privatize getTotalClip
R=robertphillips@google.com, djsollen@google.com
TBR=robertphilips

Author: reed@google.com

Review URL: https://codereview.chromium.org/546493002
2014-09-04 12:14:36 -07:00
robertphillips
c5ba71d2e5 Change SkPicture::draw to playback
R=reed@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/540963002
2014-09-04 08:42:50 -07:00
robertphillips
274b4ba6bd Switch Layer Hoisting over to SkRecord backend
R=bsalomon@google.com
TBR=bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/540543002
2014-09-04 07:24:18 -07:00
bsalomon
00b76bd750 Add reference base class to GrGpuResourcewith pending IO references.
BUG=skia:2889
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/533343002
2014-09-03 14:05:49 -07:00
robertphillips
2ed8a75c28 Remove use of EXPERIMENTAL_getActiveOps from layer hoisting code
This is getting in the way of switching to the SkRecord backend and is of questionable value.

R=bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/539693002
2014-09-03 13:46:02 -07:00
reed
e5ea500d47 Hide fields in SkImageInfo
R=rmistry@google.com
TBR=bsalomon

Author: reed@google.com

Review URL: https://codereview.chromium.org/536003002
2014-09-03 11:54:58 -07:00
robertphillips
d982eb22d7 Replace SkPictureReplacementPlayback with GrRecordReplaceDraw
I think this is sufficiently specialized to keep it in Ganesh for the time being.

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

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/535953002
2014-09-03 11:04:31 -07:00
reed
2bdf1f56c3 Revert of Add gamma/sRGB tag to SkImageInfo (patchset #1 id:1 of https://codereview.chromium.org/527073003/)
Reason for revert:
virtual gpu failures in layouttests

http://build.chromium.org/p/tryserver.blink/builders/linux_blink_dbg/builds/23717

[6:6:0903/041147:1700960503:INFO:SkBitmap.cpp(1003)] ../../third_party/skia/src/core/SkBitmap.cpp:1003: failed assertion "fPixelRef->info() == pixelRef->info()"

[6:6:0903/041147:1700961002:FATAL:SkBitmap.cpp(1003)] SK_CRASH
#0 0x7f9867df2c1e base::debug::StackTrace::StackTrace()
#1 0x7f9867e89e05 logging::LogMessage::~LogMessage()
#2 0x7f98689c4970 SkDebugf_FileLine()
#3 0x7f986870ebc6 SkBitmap::deepCopyTo()
#4 0x7f98690a3b6d blink::deepSkBitmapCopy()
#5 0x7f98690a3abe blink::ImageBuffer::copyImage()
#6 0x7f985fd4479e blink::ImageBitmap::ImageBitmap()
#7 0x7f985fd45942 blink::ImageBitmap::create()
#8 0x7f985fd84fdc blink::ImageBitmapFactories::createImageBitmap()
#9 0x7f985fd84d11 blink::ImageBitmapFactories::createImageBitmap()
#10 0x7f985ec9a7f2 blink::LocalDOMWindowV8Internal::createImageBitmap13Method()
#11 0x7f985ec96b0c blink::LocalDOMWindowV8Internal::createImageBitmapMethod()
#12 0x7f985ec91954 blink::LocalDOMWindowV8Internal::createImageBitmapMethodCallback()
#13 0x7f9869955af0 v8::internal::FunctionCallbackArguments::Call()
#14 0x7f98699833bd v8::internal::Builtin_HandleApiCall()

Original issue's description:
> Add gamma/sRGB tag to SkImageInfo
>
> This reverts commit 1cbc68f965.
>
> requires this to land in blink https://codereview.chromium.org/531883002/
>
> Committed: https://skia.googlesource.com/skia/+/2f6abdecc5c2f21da13003c615903679abc73fc7

R=fmalita@google.com, reed@chromium.org
TBR=fmalita@google.com, reed@chromium.org
NOTREECHECKS=true
NOTRY=true

Author: reed@google.com

Review URL: https://codereview.chromium.org/535113002
2014-09-03 05:48:56 -07:00
reed
2f6abdecc5 Add gamma/sRGB tag to SkImageInfo
This reverts commit 1cbc68f965.

requires this to land in blink https://codereview.chromium.org/531883002/

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/527073003
2014-09-02 21:56:40 -07:00
pkasting
280c2c6fbb Address MSVC warnings about possible value truncation. In the process removes some apparently unused code.
BUG=81439
TEST=none
R=reed@google.com

Author: pkasting@chromium.org

Review URL: https://codereview.chromium.org/517763002
2014-09-02 13:40:48 -07:00
djsollen
5ee785d9c7 Remove legacy (and also broken) SkPicture constructor.
R=robertphillips@google.com, reed@google.com

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/532703004
2014-09-02 13:34:49 -07:00
jvanverth
17a845f760 Fix matrix similarity test on arm64
Addresses precision issue by using a simpler test.
Also fixes issues with IvMatrix::preservesRightAngles, and adds unit tests.

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

Author: jvanverth@google.com

Review URL: https://codereview.chromium.org/520123002
2014-09-02 13:15:41 -07:00
reed
848250415e make allocPixels throw on failure
BUG=skia:
R=mtklein@google.com, fmalita@google.com, fmalita@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/510423005
2014-09-02 12:50:45 -07:00
robertphillips
98d709bc8d Reorganize Layer Hoisting code
With the new MultiPictureDraw API the GrContext will be performing the layer hoisting (instead of the SkGpuDevice). This CL being moving the layer hoisting functionality to GrLayerHoister rather then dumping it straight into GrContext.

R=bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/531733003
2014-09-02 10:20:50 -07:00
reed
1cbc68f965 Revert of Revert of Revert of Add gamma/sRGB tag to SkImageInfo (patchset #1 id:1 of https://codereview.chromium.org/532583002/)
Reason for revert:
linux_blink_rel

[ RUN      ] DeferredImageDecoderTest.drawIntoSkPicture
../../third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp:172: Failure
Value of: canvasBitmap.getColor(0, 0)
Actual: 0
Expected: static_cast<SkColor>( (static_cast<U8CPU>(255) << 24) | (static_cast<U8CPU>(255) << 16) | (static_cast<U8CPU>(255) << 8) | (static_cast<U8CPU>(255) << 0))
Which is: 4294967295
[  FAILED  ] DeferredImageDecoderTest.drawIntoSkPicture (0 ms)
[1457/1458] DeferredImageDecoderTest.drawIntoSkPicture (0 ms)
[ RUN      ] DeferredImageDecoderTest.decodeOnOtherThread
../../third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp:233: Failure
Value of: canvasBitmap.getColor(0, 0)
Actual: 0
Expected: static_cast<SkColor>( (static_cast<U8CPU>(255) << 24) | (static_cast<U8CPU>(255) << 16) | (static_cast<U8CPU>(255) << 8) | (static_cast<U8CPU>(255) << 0))
Which is: 4294967295
[  FAILED  ] DeferredImageDecoderTest.decodeOnOtherThread (1 ms)
[1458/1458] DeferredImageDecoderTest.decodeOnOtherThread (1 ms)
Retrying 2 tests (retry #2)

Original issue's description:
> Revert of Revert of Add gamma/sRGB tag to SkImageInfo (patchset #1 id:1 of https://codereview.chromium.org/525113005/)
>
> Reason for revert:
> Experiment to see resulting failures
>
> Original issue's description:
> > Revert of Add gamma/sRGB tag to SkImageInfo (patchset #1 id:1 of https://codereview.chromium.org/522813002/)
> >
> > Reason for revert:
> > seems to be breaking layout tests in roll
> >
> > Original issue's description:
> > > Add gamma/sRGB tag to SkImageInfo
> > >
> > > This reverts commit 64ba5fa1ff.
> > >
> > > BUG=skia:
> > >
> > > Committed: https://skia.googlesource.com/skia/+/c89aa509d6a094bc1b18d73135343819903a9cfb
> >
> > TBR=reed@google.com
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/b44c1895afae516cb851cd1a0cea83343c354ee4
>
> TBR=reed@google.com
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4581828014eb3d015e6ed55c9a5b6932b8751818

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

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/524593005
2014-09-02 04:14:37 -07:00
reed
4581828014 Revert of Revert of Add gamma/sRGB tag to SkImageInfo (patchset #1 id:1 of https://codereview.chromium.org/525113005/)
Reason for revert:
Experiment to see resulting failures

Original issue's description:
> Revert of Add gamma/sRGB tag to SkImageInfo (patchset #1 id:1 of https://codereview.chromium.org/522813002/)
>
> Reason for revert:
> seems to be breaking layout tests in roll
>
> Original issue's description:
> > Add gamma/sRGB tag to SkImageInfo
> >
> > This reverts commit 64ba5fa1ff.
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/c89aa509d6a094bc1b18d73135343819903a9cfb
>
> TBR=reed@google.com
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/b44c1895afae516cb851cd1a0cea83343c354ee4

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

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/532583002
2014-09-01 18:36:24 -07:00
reed
b44c1895af Revert of Add gamma/sRGB tag to SkImageInfo (patchset #1 id:1 of https://codereview.chromium.org/522813002/)
Reason for revert:
seems to be breaking layout tests in roll

Original issue's description:
> Add gamma/sRGB tag to SkImageInfo
>
> This reverts commit 64ba5fa1ff.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c89aa509d6a094bc1b18d73135343819903a9cfb

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

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/525113005
2014-09-01 14:28:32 -07:00
reed
c89aa509d6 Add gamma/sRGB tag to SkImageInfo
This reverts commit 64ba5fa1ff.

BUG=skia:
R=reed@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/522813002
2014-09-01 12:14:29 -07:00
bsalomon
6267f81f3d Move MakeDivByTextureWHMatrix to GrCoordTransform
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/522873005
2014-08-29 15:05:53 -07:00
robertphillips
a8d7f0b13c Try out scalar picture sizes
This paves the way for removing the 'fTile' parameter from SkPictureShader (although that should be a different CL). If we like this we could also move to providing an entire cull SkRect.

R=reed@google.com, mtklein@google.com, fmalita@google.com, fmalita@chromium.org

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/513983002
2014-08-29 08:03:56 -07:00
reed
64ba5fa1ff Revert of Add gamma/sRGB tags to SkImageInfo (patchset #1 of https://codereview.chromium.org/517123002/)
Reason for revert:
Seems to be triggering assert in blink

SSLUITest.TestRedirectHTTPToBadHTTPS (run #1):
[ RUN      ] SSLUITest.TestRedirectHTTPToBadHTTPS
HTTP server started on http://127.0.0.1:58000...
sending server_data: {"host": "127.0.0.1", "port": 58000} (36 bytes)
HTTPS server started on https://127.0.0.1:58009...
sending server_data: {"host": "127.0.0.1", "port": 58009} (36 bytes)
ASSERTION FAILED: info.fAlphaType == m_imageInfo.fAlphaType
../../third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp(78) : virtual bool blink::DecodingImageGenerator::onGetPixels(const SkImageInfo &, void *, size_t, SkPMColor *, int *)
1   0x77eb0d3 blink::DecodingImageGenerator::onGetPixels(SkImageInfo const&, void*, unsigned long, unsigned int*, int*)
2   0x92edddc SkImageGenerator::getPixels(SkImageInfo const&, void*, unsigned long, unsigned int*, int*)
3   0x92adf78 SkDiscardablePixelRef::onNewLockPixels(SkPixelRef::LockRec*)
4   0x9369283 SkPixelRef::lockPixels(SkPixelRef::LockRec*)
5   0x9369433 SkPixelRef::lockPixels()
6   0x9213344 SkBitmap::lockPixels() const
7   0x921ca57 SkAutoLockPixels::SkAutoLockPixels(SkBitmap const&, bool)
8   0x921ad80 SkAutoLockPixels::SkAutoLockPixels(SkBitmap const&, bool)
9   0x92b7125 SkDraw::drawBitmap(SkBitmap const&, SkMatrix const&, SkPaint const&) const
10  0x921f4fb SkBitmapDevice::drawBitmap(SkDraw const&, SkBitmap const&, SkMatrix const&, SkPaint const&)
11  0x921f8c7 SkBitmapDevice::drawBitmapRect(SkDraw const&, SkBitmap const&, SkRect const*, SkRect const&, SkPaint const&, SkCanvas::DrawBitmapRectFlags)
12  0x9288e12 SkCanvas::internalDrawBitmapRect(SkBitmap const&, SkRect const*, SkRect const&, SkPaint const*, SkCanvas::DrawBitmapRectFlags)
13  0x9288ee9 SkCanvas::drawBitmapRectToRect(SkBitmap const&, SkRect const*, SkRect const&, SkPaint const*, SkCanvas::DrawBitmapRectFlags)

Original issue's description:
> Add gamma/sRGB tags to SkImageInfo
>
> requires this CL to land in chrome
> https://codereview.chromium.org/517803002/
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/228b285ba14a6e9b6d1cc95ea1583caab30168a1

R=fmalita@google.com, fmalita@chromium.org, reed@chromium.org
TBR=fmalita@chromium.org, fmalita@google.com, reed@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: reed@google.com

Review URL: https://codereview.chromium.org/519583004
2014-08-29 07:50:28 -07:00
bsalomon
32d0b3b546 Simplify SkGpuDevice construction
R=robertphillips@google.com, reed@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/506413004
2014-08-29 07:50:23 -07:00
reed
228b285ba1 Add gamma/sRGB tags to SkImageInfo
requires this CL to land in chrome
https://codereview.chromium.org/517803002/

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/517123002
2014-08-29 04:08:43 -07:00
reed
088f4b8eb3 Revert of Revert of Revert of add gamma/sRGB to SkImageInfo (patchset #1 of https://codereview.chromium.org/511363002/)
Reason for revert:
android builder in chrome reveals the caller using { } initialization for SkImageInfo, which this CL now makes illegal. Will have to fix the call site before I can re-land this

Original issue's description:
> Revert of Revert of add gamma/sRGB to SkImageInfo (patchset #1 of https://codereview.chromium.org/512243002/)
>
> Reason for revert:
> this revert was premature -- the chrome canary I looked at is old, and newer ones were green. So trying again...
>
> Original issue's description:
> > Revert of add gamma/sRGB to SkImageInfo (patchset #4 of https://codereview.chromium.org/514753002/)
> >
> > Reason for revert:
> > breaks linker on chrome -- may need SK_API, but not sure.
> >
> > Original issue's description:
> > > add gamma/sRGB to SkImageInfo
> > >
> > > BUG=skia:
> > >
> > > Committed: https://skia.googlesource.com/skia/+/615c369777258231054840a88cdb74c68c382485
> >
> > TBR=bungeman@google.com,bsalomon@google.com
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/dc53701216c0e9f98eacf6c0cda769ebbd200b59
>
> TBR=bungeman@google.com,bsalomon@google.com
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/e759a2662273fdf52ebbb3822229945eda317e46

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/517113002
2014-08-28 14:46:19 -07:00
reed
0b4abb904e Revert of add SK_API to SkImageInfo (patchset #1 of https://codereview.chromium.org/513333003/)
Reason for revert:
need to revert the big ImageInfo CL but since this was landed on top of it, I need to revert this guy first.

Original issue's description:
> add SK_API to SkImageInfo
>
> BUG=skia:
> TBR=bungeman
> NOTRY=True
>
> Committed: https://skia.googlesource.com/skia/+/bedec8456ff0ea814ed1bba748a86678f458d063

TBR=
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: reed@google.com

Review URL: https://codereview.chromium.org/518543002
2014-08-28 14:44:23 -07:00
fmalita
aa1b912046 Expose drawTextBlob to devices.
Instead of unrolling blobs in SkCanvas, perform the equivalent ops in
SkBaseDevice.

This depends on https://codereview.chromium.org/511783005/.

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

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/517663003
2014-08-28 14:32:24 -07:00
mtklein
0209e95cc2 Align all SkRecord::alloc() calls up to at least a pointer size.
This should make the LSAN bots able to see all our pointers.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/517073002
2014-08-28 14:10:05 -07:00
bsalomon
23b406cc04 Make SkGpuDevice constructors private.
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/517033002
2014-08-28 14:06:42 -07:00
fmalita
228a6f275d SkTextBlob GPipe serialization.
Instead of relying on unrolling blobs in SkCanvas, serialize when
passing through a GPipe.

This is a prerequisite for pushing the blob draw op to the device.

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

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/511783005
2014-08-28 13:59:42 -07:00
reed
bedec8456f add SK_API to SkImageInfo
BUG=skia:
TBR=bungeman
NOTRY=True

Author: reed@google.com

Review URL: https://codereview.chromium.org/513333003
2014-08-28 13:37:52 -07:00
reed
011f39aeb2 rename ScaledImageCache to ResourceCache
BUG=skia:
R=bsalomon@google.com, mtklein@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/511283002
2014-08-28 13:35:23 -07:00
reed
e759a26622 Revert of Revert of add gamma/sRGB to SkImageInfo (patchset #1 of https://codereview.chromium.org/512243002/)
Reason for revert:
this revert was premature -- the chrome canary I looked at is old, and newer ones were green. So trying again...

Original issue's description:
> Revert of add gamma/sRGB to SkImageInfo (patchset #4 of https://codereview.chromium.org/514753002/)
>
> Reason for revert:
> breaks linker on chrome -- may need SK_API, but not sure.
>
> Original issue's description:
> > add gamma/sRGB to SkImageInfo
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/615c369777258231054840a88cdb74c68c382485
>
> TBR=bungeman@google.com,bsalomon@google.com
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/dc53701216c0e9f98eacf6c0cda769ebbd200b59

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/511363002
2014-08-28 11:57:34 -07:00
bsalomon
744998e666 Make textures register with GrResourceCache2 as scratch.
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/510053003
2014-08-28 09:54:34 -07:00
reed
dc53701216 Revert of add gamma/sRGB to SkImageInfo (patchset #4 of https://codereview.chromium.org/514753002/)
Reason for revert:
breaks linker on chrome -- may need SK_API, but not sure.

Original issue's description:
> add gamma/sRGB to SkImageInfo
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/615c369777258231054840a88cdb74c68c382485

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/512243002
2014-08-28 06:53:19 -07:00
reed
615c369777 add gamma/sRGB to SkImageInfo
BUG=skia:
R=bungeman@google.com, bsalomon@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/514753002
2014-08-28 05:56:37 -07:00
robertphillips
d62833079f Switch GPU Optimization code to SkRecord
R=mtklein@google.com, bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/504393002
2014-08-27 11:53:28 -07:00
mtklein
533eb782ed Convert BBH APIs to use SkRect.
Still TODO: convert internals of SkTileGrid.cpp and SkRTree.cpp to work in floats too.

NOTREECHECKS=true

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/511613002
2014-08-27 10:39:42 -07:00
mtklein
2a65a238b0 Remove SkQuadTree.
We're not testing it to the same degree we do RTree and TileGrid.  Any changes
we'll make to BBH APIs become 33% easier without it.  If find we want it again,
we can always resurrect it.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/500373005
2014-08-26 14:07:04 -07:00
senorblanco
8a914a7650 Remove SkImageFilter::Set/GetExternalCache.
These were removed from the .cpp in
be129b26f1, but I forgot to remove them
from the header.

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

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/492693003
2014-08-26 14:06:01 -07:00
bsalomon
169612621f Make GrGpuResources register with GrResourceCache2 after fully constructed.
Committed: https://skia.googlesource.com/skia/+/d68b3e491bb765beb7ca5e4ac8e0c80dedf5a83b

R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/504313002
2014-08-26 14:01:07 -07:00
bsalomon
a2b0af82f0 Revert of Make GrGpuResources register with GrResourceCache2 after fully constructed. (patchset #3 of https://codereview.chromium.org/504313002/)
Reason for revert:
Breaking the bots

Original issue's description:
> Make GrGpuResources register with GrResourceCache2 after fully constructed.
>
> Committed: https://skia.googlesource.com/skia/+/d68b3e491bb765beb7ca5e4ac8e0c80dedf5a83b

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

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/488463004
2014-08-26 13:11:11 -07:00
bsalomon
d68b3e491b Make GrGpuResources register with GrResourceCache2 after fully constructed.
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/504313002
2014-08-26 12:51:20 -07:00
senorblanco
5e5f948b6b Reimplement deserialization of SkImageFilter's uniqueID.
9fa60d ("Simplify flattening to just write enough ... ") simplified just
a tad too much. In particular, it disabled deserialization of
SkImageFilter's uniqueID, which in turn caused the failure of
SkImageFilter's cache, which caused a large regression in Chrome's SVG
filter performance.

The medium-term fix is to switch to the new SkRecordDraw SkPicture
backend, which will make the unique IDs unnecessary.

This change is an "in case of emergecy" CL, in the event that there are
problems switching on the new backend in Chrome. For that reason, it's
minimalist: only the filters used by Chrome are modified, and whitespace
changes are kept to a minimum. In this way, it should be easy to revert
once the new backend goes in.

R=reed@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/503833002
2014-08-26 12:27:12 -07:00
reed
99ae881a7f remove (unused) scale parameter from measureText
BUG=skia:
R=bungeman@google.com, djsollen@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/510433002
2014-08-26 11:30:01 -07:00
halcanary
1790e25e18 SkAutoTDelete::operator T*()
R=reed@google.com, bungeman@google.com, mtklein@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/506963002
2014-08-26 11:06:25 -07:00
rmistry
c3cf5a515d Revert of Testing TBR'ing public API owners (patchset #1 of https://codereview.chromium.org/486203009/)
Reason for revert:
Reverting whitespace change

Original issue's description:
> Testing TBR'ing public API owners
>
> BUG=skia:2870
> TBR=xyz,reed
> NOTRY=true
>
> (SkipBuildbotRuns)
>
> Committed: https://skia.googlesource.com/skia/+/96b77dee4e985513abd4042db088bd286fd84383

TBR=
NOTREECHECKS=true
NOTRY=true
BUG=skia:2870

(SkipBuildbotRuns)

Author: rmistry@google.com

Review URL: https://codereview.chromium.org/504193003
2014-08-26 10:43:14 -07:00
rmistry
96b77dee4e Testing TBR'ing public API owners
BUG=skia:2870
TBR=xyz,reed
NOTRY=true

(SkipBuildbotRuns)

Author: rmistry@google.com

Review URL: https://codereview.chromium.org/486203009
2014-08-26 10:41:21 -07:00
fmalita
b7425173f9 SkTextBlob plumbing
Add SkTextBlob serialization + drawTextBlob() overrides.

R=mtklein@google.com, reed@google.com, robertphillips@google.com
BUG=269080

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/499413002
2014-08-26 07:56:44 -07:00
kkinnunen
ec56e45454 Implement NV_path_rendering on OpenGL ES
Implement support for NV_path_rendering on OpenGL ES. Use
glProgramPathFragmentInputGenNV function call instead of glPathTexGenNV to
communicate transforms to fragment shader.

The intention is that the NVPR paths will be drawn with the same shader program
as non-NVPR geometry. For NVPR calls, the GPU will skip the vertex shader and
just run the fragment shader.

After program is linked, query the locations of the fragment shader inputs with
glGetResourceLocation. The location will be used to set the transforms with
glProgramPathFragmentInputGenNV.

The functions and their workings are documented in:

glProgramPathFragmentInputGenNV
https://www.opengl.org/registry/specs/NV/path_rendering.txt
(note: addition as of API version 1.3)

glGetResourceLocation
https://www.opengl.org/registry/specs/ARB/program_interface_query.txt
http://www.opengl.org/registry/doc/glspec44.core.pdf
(function is in core Open GL 4.4)

Note: glProgramPathFragmentInputGenNV could be used also for OpenGL. However,
using seems to trigger a bug in the driver. Disable this feature on OpenGL at
least until the driver is fixed and released. The bug manifests in shadertext
test, where the lower-left text pair is missing. Valgrind catches a bad read
for the test and causes the context to OOM reproducibly.

R=bsalomon@google.com, cdalton@nvidia.com, joshualitt@google.com, joshualitt@chromium.org

Author: kkinnunen@nvidia.com

Review URL: https://codereview.chromium.org/367643004
2014-08-25 22:21:16 -07:00
bungeman
a6785ccb54 Add a working SkFontMgr_fontconfig.
R=tomhudson@google.com, reed@google.com, mtklein@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/396143004
2014-08-25 12:00:49 -07:00
mtklein
bc97ef4271 Document return value of SkPaint::operator==.
BUG=skia:1491
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/467063003
2014-08-25 10:10:47 -07:00
jbroman
3053dfaefd Add SK_API to SkTextBlob and SkTextBlobBuilder.
BUG=skia:2868
R=fmalita@chromium.org, reed@google.com

Author: jbroman@chromium.org

Review URL: https://codereview.chromium.org/497993002
2014-08-25 06:22:12 -07:00
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