optimize impl to not require another level of indirection (SkData) for storage.
add unittests for flattening.
optimize builder to not make a deepcopy of its chunkalloc heap.
git-svn-id: http://skia.googlecode.com/svn/trunk@8790 2bbb7eff-a529-9590-31e7-b0007b416f81
modify threaded path ops tests to check
Background: this CL came out of a conversation with Eric where I learned that 10s of machines host 100s of bots. Since the bot hosting tests may be shared with many other tasks, it seems unwise for path ops to launch multiple test threads.
The change here is to make launching multiple threads "opt-in" and by default, bots can run path ops in a single thread.
Review URL: https://codereview.chromium.org/14002007
git-svn-id: http://skia.googlecode.com/svn/trunk@8750 2bbb7eff-a529-9590-31e7-b0007b416f81
fix bugs in tests on 32 bit release
Most changes revolve around pinning computed t values
very close to zero and one.
git-svn-id: http://skia.googlecode.com/svn/trunk@8745 2bbb7eff-a529-9590-31e7-b0007b416f81
Try to fix the 32 bit build by making some math
decisions more robust.
Rewrite the cubic intersection special case that
detects if only end points are shared.
Rewrite the angle sort setup that computes whether
a cubic bends to the left or right.
git-svn-id: http://skia.googlecode.com/svn/trunk@8726 2bbb7eff-a529-9590-31e7-b0007b416f81
This fixes the following clang error:
../../tests/XfermodeTest.cpp:43:44: error: comparison of constant -1 with expression of type 'SkXfermode::Mode' is always false [-Werror,-Wtautological-constant-out-of-range-compare]
REPORTER_ASSERT(reporter, reportedMode == -1);
~~~~~~~~~~~~ ^ ~~
R=vandebo@chromium.org,reed@google.com
Review URL: https://codereview.chromium.org/14180004
git-svn-id: http://skia.googlecode.com/svn/trunk@8692 2bbb7eff-a529-9590-31e7-b0007b416f81
standardize tests
use SK_ARRAY_COUNT everywhere
debug why x87 differs from SIMD 64
various platform specific fixes
git-svn-id: http://skia.googlecode.com/svn/trunk@8689 2bbb7eff-a529-9590-31e7-b0007b416f81
The fImmediateDevice member of DeferredDevice (SkDeferredCanvas.cpp) was becoming invalid after a fork of the backingstore in SkSurface_Gpu cause the device to be substituted.
New unit test code was to exercise SkSurface copy on write with draws that are deferred in GrInOrderDrawBuffer. The bad pointer was causing the test to crash.
TEST=skia unit test DeferredCanvas, subtest TestDeferredCanvasSurface
Review URL: https://codereview.chromium.org/14263015
git-svn-id: http://skia.googlecode.com/svn/trunk@8686 2bbb7eff-a529-9590-31e7-b0007b416f81
This temporarily disables SK_ENABLE_INST_COUNT
( skbug.com/1219 )
This fixes a linktime error on VS2012 in
PathTest.cpp; -SK_ScalarInfinity should be
SK_ScalarNegativeInfinity instead.
This adds pathops and pathops unit tests to the
main unit tests.
Should this change destabilize anything, it should
be sufficient to comment out the pathops gypi
includes. at test.gyp:18,21.
Review URL: https://codereview.chromium.org/14137010
git-svn-id: http://skia.googlecode.com/svn/trunk@8644 2bbb7eff-a529-9590-31e7-b0007b416f81
I don't understand why this change is necessary. On Android,
SkCommandLineFlags.h is not found, but only in this project.
Other projects depend on flags and include the file without
using the full path. Likewise, this works on other platforms.
Removing for now until I figure out the correct fix.
Review URL: https://codereview.chromium.org/13910008
git-svn-id: http://skia.googlecode.com/svn/trunk@8621 2bbb7eff-a529-9590-31e7-b0007b416f81
- fix rand for Android
- build unit test on linux
- use atomic inc in test count
- add casting for Android
git-svn-id: http://skia.googlecode.com/svn/trunk@8610 2bbb7eff-a529-9590-31e7-b0007b416f81
subDivide limit. This caused problems with degenate paths (too much recursion).
The fix was two parts:
1. decrement the subDivide limit as we recurse
2. up the limit for cubics to 7, to match our current quality
added unittest that replicated the too-much-recursion bug.
Review URL: https://codereview.chromium.org/14086002
git-svn-id: http://skia.googlecode.com/svn/trunk@8599 2bbb7eff-a529-9590-31e7-b0007b416f81
This CL depends on
https://codereview.chromium.org/12880016/
"Add intersections for path ops"
Given a path, iterate through its contour, and
construct an array of segments containing its curves.
Intersect each curve with every other curve, and for
cubics, with itself.
Given the set of intersections, find one with the
smallest y and sort the curves eminating from the
intersection. Assign each curve a winding value.
Operate on the curves, keeping and discarding them
according to the current operation and the sum of
the winding values.
Assemble the kept curves into an output path.
Review URL: https://codereview.chromium.org/13094010
git-svn-id: http://skia.googlecode.com/svn/trunk@8553 2bbb7eff-a529-9590-31e7-b0007b416f81
This CL depends on
https://codereview.chromium.org/12827020/
"Add base types for path ops"
The intersection of a line, quadratic, or cubic
with another curve (or with itself) is found by
solving the implicit equation for the curve pair.
The curves are first reduced to find the simplest
form that will describe the original, and to detect
degenerate or special-case data like horizontal and
vertical lines.
For cubic self-intersection, and for a pair of cubics,
the intersection is found by recursively
approximating the cubic with a series of quadratics.
The implicit solutions depend on the root finding
contained in the DCubic and DQuad structs, and
the quartic root finder included here.
Review URL: https://codereview.chromium.org/12880016
git-svn-id: http://skia.googlecode.com/svn/trunk@8552 2bbb7eff-a529-9590-31e7-b0007b416f81
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
added capability to collect minidump and callstack if buildbot fails with heap
coruption in windows, and a NPE bug was fixed in SkPDFDocument, when document was destroyed without ever beeing used and a field was NULL + a few minor conflicts have been resolved)
git-svn-id: http://skia.googlecode.com/svn/trunk@8487 2bbb7eff-a529-9590-31e7-b0007b416f81
Replace the old attribute binding and index interface with one where we include the binding as part of the attribute array. Also removed the fixed attribute indices for constant color and coverage attributes, and replaced with dynamic ones based on current attribute set. Removed binding of color and coverage attributes unless they're actually set.
Original author: bsalomon@google.com
Author: jvanverth@google.com
Reviewed By: bsalomon@google.com,robertphillips@google.com
Review URL: https://chromiumcodereview.appspot.com/13296005
git-svn-id: http://skia.googlecode.com/svn/trunk@8468 2bbb7eff-a529-9590-31e7-b0007b416f81
Replace the old attribute binding and index interface with one where we include the binding as part of the attribute array. Also removed the fixed attribute indices for constant color and coverage attributes, and replaced with dynamic ones based on current attribute set. Removed binding of color and coverage attributes unless they're actually set.
Original author: bsalomon@google.com
Author: jvanverth@google.com
Reviewed By: bsalomon@google.com,robertphillips@google.com
Review URL: https://chromiumcodereview.appspot.com/13296005
git-svn-id: http://skia.googlecode.com/svn/trunk@8466 2bbb7eff-a529-9590-31e7-b0007b416f81
This strips out last of the edge types and the fixed function edge attribute and replaces them with using GrEdgeEffect. Also fixes a minor bug when checking attribute counts -- it was using kAttribIndexCount instead of kVertexAttribCnt.
Original Author: jvanverth@google.com
Review URL: https://codereview.chromium.org/13069003
git-svn-id: http://skia.googlecode.com/svn/trunk@8392 2bbb7eff-a529-9590-31e7-b0007b416f81
Effects can ask the builder for local coords which may or may not be distinct from positions.
GrEffectStage tracks changes to relationship between pos and local coords.
GrGLEffectMatrix and GrSingleTextureEffect can use either pos or textures as intput coords
GrSimpleTextureEffect now allows for an explicit texture coords attribute.
Review URL: https://codereview.chromium.org/12531015
git-svn-id: http://skia.googlecode.com/svn/trunk@8264 2bbb7eff-a529-9590-31e7-b0007b416f81
Adds some optimizations to the circle and ellipse shaders, static effect
instances for their GrEffects, and some minor changes to GrDrawState::setEffect
to make GrEffect setup faster.
git-svn-id: http://skia.googlecode.com/svn/trunk@8238 2bbb7eff-a529-9590-31e7-b0007b416f81
SkPurgeableImageCache:
New image cache that uses virtual memory to store the pixels. Combines
features of SkAshmemImageCache (which has been removed) with SkPurgeableMemoryBlock, which has android and Mac versions.
SkImageCache:
Modified the API. pinCache now returns a status out parameter which
states whether the pinned memory retained the old data. This allows
allocAndPinCache to only be used for allocations.
Add a new debug only interface to purge unpinned data.
Updates to documentation, clarifying behavior.
Changed CachedStatus to MemoryStatus
SkLruImageCache:
Implement the new function purgeAllUnpinnedCaches and change implementation
of pinCache for the new behavior.
SkLazyPixelRef:
Rewrite onLockPixels to account for the new behavior of pinCache.
BitmapFactoryTest:
Test the new SkPurgeableImageCache.
Write tests which directly test the SkImageCaches.
Create a larger bitmap, since some of the SkImageCaches are designed
to handle large bitmaps.
bench_ and render_pictures:
Consolidate lazy_decode_bitmap into one function.
Allow using a flag to specify using the purgeable image cache.
Clean up some #includes.
Review URL: https://codereview.chromium.org/12433020
git-svn-id: http://skia.googlecode.com/svn/trunk@8207 2bbb7eff-a529-9590-31e7-b0007b416f81