Commit Graph

2026 Commits

Author SHA1 Message Date
sugoi
b227e37eae JPEG YUV Decoding
Enabling JPEG YUV Decoding in Skia

BUG=skia:3005, skia:1674, skia:3029

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

Review URL: https://codereview.chromium.org/399683007
2014-10-16 13:10:57 -07:00
piotaixr
65151754b9 Override SkCanvas::drawImage() in SkRecorder.
BUG=skia:2947

Review URL: https://codereview.chromium.org/610003002
2014-10-16 11:58:39 -07:00
kkinnunen
30bc88ccd5 Refactor SkGLContext to be actually extendable
Refactor SkGLContext to be actually extendable. Before, non-trivial subclass
would need to destroy the GL connection upon running the destructor. However,
the base class would run GL commands in its own destructor (with destroyed GL
connection)

Refactor so that SkGLContext subclass object creation is completely done by
the factory function. If the factory function returns a non-NULL ptr, it means the context
is usable.

The destruction is done with the destructor instead of virtual function called
upon destruction. Make the destructors not to call virtual functions, for
clarity.

Remove custom 1x1 FBO setup code from the base class. It appears not to be used
anymore.

BUG=skia:2992

Review URL: https://codereview.chromium.org/640283004
2014-10-15 23:03:54 -07:00
egdaniel
9e4d6d180f Move willUseInputColor check to computeInvariantOutput
BUG=skia:

Review URL: https://codereview.chromium.org/656503002
2014-10-15 13:49:02 -07:00
cdalton
6819df3644 Adds a GrTRecorder class that GrInOrderDrawBuffer uses to allocate
all its commands interleaved in contiguous memory. GrTRecorder also
supports extra data associated with objects, so we can store arrays
inline without having to call malloc().

Committed: https://skia.googlesource.com/skia/+/360b6801cfd90485891d709e44cf395d527ba69e

Review URL: https://codereview.chromium.org/628453002
2014-10-15 13:43:48 -07:00
rmistry
3ac569b37a Revert of JPEG YUV Decoding (patchset #5 id:180001 of https://codereview.chromium.org/399683007/)
Reason for revert:
Caused many test bots to go red:
http://build.chromium.org/p/client.skia/builders/Test-ChromeOS-Alex-GMA3150-x86-Release/builds/22/steps/dm/logs/stdio
http://build.chromium.org/p/client.skia/builders/Test-ChromeOS-Link-HD4000-x86_64-Debug/builds/168/steps/dm/logs/stdio
http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX660-x86-Release/builds/38/steps/dm/logs/stdio

Original issue's description:
> JPEG YUV Decoding
>
> Enabling JPEG YUV Decoding in Skia
>
> BUG=skia:3005, skia:1674
>
> Committed: https://skia.googlesource.com/skia/+/8e6c3b93a39e19111662a760ede97df55e51d39f

TBR=reed@google.com,scroggo@google.com,sugoi@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:3005, skia:1674

Review URL: https://codereview.chromium.org/656163002
2014-10-15 13:15:58 -07:00
bsalomon
98b33ebe6f Some cleanup in processor header files.
R=joshualitt@google.com

Review URL: https://codereview.chromium.org/659803004
2014-10-15 11:05:26 -07:00
sugoi
8e6c3b93a3 JPEG YUV Decoding
Enabling JPEG YUV Decoding in Skia

BUG=skia:3005, skia:1674

Review URL: https://codereview.chromium.org/399683007
2014-10-15 11:04:18 -07:00
bsalomon
6251d17dfa Split GrFragmentProcessor into its own header
Review URL: https://codereview.chromium.org/660573002
2014-10-15 10:50:36 -07:00
reed
bcba2c9f9f interesct path bounds with clip bounds before initializing supersampler
BUG=skia:

Review URL: https://codereview.chromium.org/656473004
2014-10-15 08:52:00 -07:00
bsalomon
0e08fc17e4 Push isEqual/onIsEqual down from GrProcessor to subclasses.
R=joshualitt@google.com

Review URL: https://codereview.chromium.org/654273002
2014-10-15 08:19:04 -07:00
reed
157f36d358 add tests for large cordinates bounds when building aaclip
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/658753002
2014-10-15 07:05:09 -07:00
mtklein
f439c77e9c Revert of Create a single command buffer for GrInOrderDrawBuffer (patchset #17 id:1240001 of https://codereview.chromium.org/628453002/)
Reason for revert:
Leaking memory:
http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind/builds/9/steps/gm/logs/stdio

Original issue's description:
> Adds a GrTRecorder class that GrInOrderDrawBuffer uses to allocate
> all its commands interleaved in contiguous memory. GrTRecorder also
> supports extra data associated with objects, so we can store arrays
> inline without having to call malloc().
>
> Committed: https://skia.googlesource.com/skia/+/360b6801cfd90485891d709e44cf395d527ba69e

TBR=bsalomon@google.com,reed@google.com,cdalton@nvidia.com
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/654863003
2014-10-14 14:29:30 -07:00
cdalton
360b6801cf Adds a GrTRecorder class that GrInOrderDrawBuffer uses to allocate
all its commands interleaved in contiguous memory. GrTRecorder also
supports extra data associated with objects, so we can store arrays
inline without having to call malloc().

Review URL: https://codereview.chromium.org/628453002
2014-10-14 11:53:05 -07:00
bsalomon
e30597375c Remove uses of GrAutoScratchTexture.
Rename GrContext::lockAndRefScratchTexture to refScratchTexture.

GrSurface::writePixels returns bool instead of void.

BUG=skia:2889

Review URL: https://codereview.chromium.org/638403003
2014-10-14 11:47:22 -07:00
mtklein
07894c4d7d Revert of Create a single command buffer for GrInOrderDrawBuffer (patchset #14 id:1050001 of https://codereview.chromium.org/628453002/)
Reason for revert:
New test failing on Android: http://build.chromium.org/p/client.skia.android/builders/Test-Android-Nexus7-Tegra3-Arm7-Release/builds/89/steps/dm/logs/stdio

Original issue's description:
> Adds a GrTBaseList class that GrInOrderDrawBuffer uses to allocate
> all its commands interleaved in contiguous memory. GrTBaseList also
> supports extra data associated with objects, so we can store arrays
> inline without having to call malloc().
>
> Committed: https://skia.googlesource.com/skia/+/47c844aaba81e5a29c773b660e1d6062c766d253

TBR=bsalomon@google.com,reed@google.com,cdalton@nvidia.com
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/652843002
2014-10-13 14:00:42 -07:00
egdaniel
ccb2e384a0 Create helper functions to use in computeInvariantOutput calls
BUG=skia:

Review URL: https://codereview.chromium.org/643743003
2014-10-13 12:53:46 -07:00
cdalton
47c844aaba Adds a GrTBaseList class that GrInOrderDrawBuffer uses to allocate
all its commands interleaved in contiguous memory. GrTBaseList also
supports extra data associated with objects, so we can store arrays
inline without having to call malloc().

Review URL: https://codereview.chromium.org/628453002
2014-10-13 12:43:10 -07:00
bsalomon
81beccc4fb Devirtualize read/write pixels on surface.
Consolidate read/write funcs in context.

Remove support for reading pixels from a surface that's not a target. It's currently broken and neither used nor tested.

Review URL: https://codereview.chromium.org/648863002
2014-10-13 12:32:55 -07:00
bsalomon
d27726eccb Fix leak in GLPrograms test.
TBR=joshualitt@google.com

Review URL: https://codereview.chromium.org/648063002
2014-10-12 05:40:01 -07:00
joshualitt
a5305a110a Opt state takes a GP instead of a GeometryStage
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/71856d520461ae025a0332aa0ce9735a096d9baf

Review URL: https://codereview.chromium.org/637003003
2014-10-10 17:47:00 -07:00
joshualitt
89c7a2ec3e Revert of Opt state takes a GP instead of a GeometryStage (patchset #18 id:1500001 of https://codereview.chromium.org/637003003/)
Reason for revert:
Revert because this may be causing a break in a chrome gpu test

Original issue's description:
> Opt state takes a GP instead of a GeometryStage
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/71856d520461ae025a0332aa0ce9735a096d9baf

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

Review URL: https://codereview.chromium.org/647183002
2014-10-10 14:11:59 -07:00
robertphillips
7bb9ed756e Fix bug in GrCachedLayer reuse
In the new MultiPictureDraw tests a single hoisted layer is reused multiple times. The previous plot locking scheme allowed GrCachedLayer objects to be aggressively deleted prematurely leaving the reusing GrHoistedLayer objects with dangling pointers.

This CL changes adds a new pseudo-ref to GrCachedLayer. (It can't be a real ref since the cached layers aren't deleted when it goes to 0).

NOTRY=true

Committed: https://skia.googlesource.com/skia/+/5c481666c9678f43e039ad605457be3854cf8de3

Review URL: https://codereview.chromium.org/640323002
2014-10-10 11:38:29 -07:00
joshualitt
71856d5204 Opt state takes a GP instead of a GeometryStage
BUG=skia:

Review URL: https://codereview.chromium.org/637003003
2014-10-10 09:56:55 -07:00
robertphillips
232f6b0f90 Remove unused SaveLayerInfo::fValid field
Minor code cleanup

Review URL: https://codereview.chromium.org/643713002
2014-10-09 16:43:42 -07:00
joshualitt
1598899975 FPs now use the correct builder types(just a rename)
BUG=skia:

Review URL: https://codereview.chromium.org/648463003
2014-10-09 15:04:05 -07:00
joshualitt
9e87fa7c0e Force linking of static member variables for GLPrograms
BUG=skia:

Review URL: https://codereview.chromium.org/614163002
2014-10-09 13:12:35 -07:00
joshualitt
651713408c gl programs rewrite
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/07a255310aca9f3e83bf741dc663a58818ad681c

Review URL: https://codereview.chromium.org/628633003
2014-10-09 07:25:36 -07:00
caryclark
99d5915a02 rename command line flag to avoid conflict, use very verbose
TBR=
NOTRY=true
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/645573003
2014-10-09 07:08:59 -07:00
mtklein
208d1704c2 Add SkBBoxHierarchy::reserve() as an optional size hint.
I want to play around with how SkTileGrid stores its tiles.  Having a
cap on the number of insert() calls can be pretty handy.

While I'm at it, I gave flush() a default empty impl.  Like reserve(),
it's really an optional hook for subclasses.

BUG=skia:

Review URL: https://codereview.chromium.org/639933003
2014-10-09 06:49:47 -07:00
caryclark
a9c56525f3 try again to fix ios build
TBR=
NOTRY=true
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/638403002
2014-10-09 06:37:50 -07:00
caryclark
ff9fc4e4c9 fix ios build
NOTREECHECKS=true
NOTRY=true
TBR=

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

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

  #define QUAD_STROKE_APPROXIMATION 1

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

Here's what's in this CL:

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

The new stroke algorithm has a tweakable parameter:

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

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

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

BUG=skia:723,skia:2769

Review URL: https://codereview.chromium.org/558163005
2014-10-09 05:36:04 -07:00
kkinnunen
9e61bb7815 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

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

Review URL: https://codereview.chromium.org/608883003
2014-10-08 08:40:09 -07:00
reed
9d93c2ebb3 Add SkCachedData and use it for SkMipMap
This reverts commit 37c5a815d8.

TBR=mtklein

Review URL: https://codereview.chromium.org/635333002
2014-10-08 05:17:12 -07:00
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
egdaniel
b109ac22b4 Make createOptDrawState return NULL if we would end up not drawing
BUG=skia:

Review URL: https://codereview.chromium.org/630063002
2014-10-07 06:45:44 -07:00
egdaniel
307796bc2e Plumb OptDrawState down to VertexShaderBuilder
BUG=skia:

Review URL: https://codereview.chromium.org/628293002
2014-10-06 12:13:54 -07:00
piotaixr
f05f5a7399 Remove globals from tests/CanvasTest.cpp
BUG=skia:

Review URL: https://codereview.chromium.org/617093004
2014-10-03 13:26:55 -07:00
reed
37c5a815d8 Speculative revert to diagnose crash in chrome. Revert "Add SkCachedData and use it for SkMipMap"
This reverts commit 92561a0b99.

crasher in question:
https://code.google.com/p/chromium/issues/detail?id=420178

Review URL: https://codereview.chromium.org/617613003
2014-10-03 13:23:31 -07:00