public_headers.gypi was never needed by Skia proper, and was almost
always out of date. Its actual user no longer needs it, so stop
updating it with every other change to public headers.
BUG=skia:2350
Review URL: https://codereview.chromium.org/683123003
Adds DrawingMethods with some of the methods it defines. Context is now
an implementation of DrawingMethods.
The sample.js file now shows how the context is used.
Not much new code here, that's mostly in DrawingMethods::DrawPath, most everything else is a code move.
BUG=skia:
Review URL: https://codereview.chromium.org/676423002
Also:
- SkWindow now has createSurface, not createCanvas.
- Add the platform init code v8 now seems to require.
- Fix library linkage.
- Call isolate->Enter(); because it doesn't look
like v8 starts with a default isolate to begin with.
BUG=skia:
Review URL: https://codereview.chromium.org/673223002
The file is unused, but we cannot safely delete it until we remove
the reference in a chromium gyp file.
BUG=skia:2350
Review URL: https://codereview.chromium.org/663913003
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
Reason for revert:
Want to think about how to do this only to skialib and not to tools (gms, tests, etc.)
Original issue's description:
> No threadsafe statics.
>
> Chrome disables these for speed and code size, so we need
> to disable them to make sure our code is safe when used
> this way.
>
> int foo() {
> static int32_t atomic_thing;
> return sk_atomic_inc(&atomic_thing);
> }
>
> is not safe in Chrome. Making the static global is:
>
> static int32_t atomic_thing;
> int foo() {
> return sk_atomic_inc(&atomic_thing);
> }
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/cad5d3e264535c919b80e1e2a85407307961f221TBR=bungeman@google.com,mtklein@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/649343003
Chrome disables these for speed and code size, so we need
to disable them to make sure our code is safe when used
this way.
int foo() {
static int32_t atomic_thing;
return sk_atomic_inc(&atomic_thing);
}
is not safe in Chrome. Making the static global is:
static int32_t atomic_thing;
int foo() {
return sk_atomic_inc(&atomic_thing);
}
BUG=skia:
Review URL: https://codereview.chromium.org/654663002
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
GCC doesn't understand -fasm-blocks or -mpascal-strings, but we don't care
about them.
While looking around in Gyp, I noticed a better way to disable warnings about
offsetof so that it doesn't tell us "disabling this warning makes no sense in C"
for every C source file we compile.
BUG=skia:
Review URL: https://codereview.chromium.org/650553002
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
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
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/+/a90ed4e83897b45d6331ee4c54e1edd4054de9a8TBR=kkinnunen@nvidia.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2992
Review URL: https://codereview.chromium.org/639793002
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
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
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/+/fe1233c3f12f81bb675718516bbb32f72af726ecTBR=bsalomon@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/635533005
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
We use this on Linux already, but for whatever reason wasn't a problem on iOS
until using it in SkPaint. Mac 10.7 and 10.8 are showing this warning too,
but seems -Werror is not enabled.
CQ_EXTRA_TRYBOTS=tryserver.skia:Build-Mac10.7-Clang-Arm7-Release-iOS-Trybot
BUG=skia:
Review URL: https://codereview.chromium.org/637593002