Commit Graph

2553 Commits

Author SHA1 Message Date
mtklein
2aa1f7e679 Port GrGLCaps over to use SkTHash.
I've written some new hashtable interfaces that should be easier to use,
and I've been trying to roll them out bit by bit, hopefully replacing
SkTDynamicHash, SkTMultiMap, SkTHashCache, etc.

This turns the cache in GrGLCaps::readPixelsSupported() into an SkTHashMap,
mapping the format key to a bool.  Functionally, it's the same.

BUG=skia:

Review URL: https://codereview.chromium.org/948473002
2015-02-20 12:35:32 -08:00
halcanary
a1f1ee98a1 PDF : New factory function for SkPDFDevice
SkPDFDevice now has factory function that matches what callers need.

Review URL: https://codereview.chromium.org/941023005
2015-02-20 06:17:26 -08:00
scroggo
87fa631969 Rename onGetPixelsEnum back to onGetPixels.
Replace the old signature of onGetPixels (return bool) to return an
enum (Result). Remove onGetPixelsEnum.

Add a define for onGetPixelsEnum to onGetPixels. This is for staging
in Chromium, where some implementations override onGetPixelsEnum.

Add the define in skia_for_chromium_defines. Remove
SK_SUPPORT_LEGACY_IMAGE_GENERATOR_RETURN, which is no longer needed by
Chromium.

BUG=skia:3257

Review URL: https://codereview.chromium.org/939113002
2015-02-19 18:44:58 -08:00
bsalomon
b602d4dff8 Speculative fix for nexus player unit test failure
TBR=robertphillips@google.com

NOTREECHECKS=true

Review URL: https://codereview.chromium.org/941433006
2015-02-19 12:05:58 -08:00
bsalomon
ddf30e64fe Handle the case when the GrResourceCache timestamp wraps.
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/916103006
2015-02-19 11:38:45 -08:00
bsalomon
02a44a4886 Recycle stencil buffers across render targets.
Review URL: https://codereview.chromium.org/939093002
2015-02-19 09:09:00 -08:00
mtklein
90c6bc4e85 Revert of notify resource caches when pixelref genID goes stale (patchset #4 id:60001 of https://codereview.chromium.org/825263005/)
Reason for revert:
Crazy failures.

http://build.chromium.org/p/client.skia/builders/Test-Mac10.8-MacMini4.1-GeForce320M-x86_64-Debug/builds/1428/steps/dm/logs/stdio

Original issue's description:
> notify resource caches when pixelref genID goes stale
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4675819b9dbb3ad71ec851776e5de26d342f29fe

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

Review URL: https://codereview.chromium.org/936423002
2015-02-19 08:53:52 -08:00
mtklein
cabc08c429 PDF: why do we have flags no one uses (or can use)?
BUG=skia:

Review URL: https://codereview.chromium.org/936403002
2015-02-19 08:29:24 -08:00
bsalomon
f99e961f55 Allow resources' unique keys to be changed.
Review URL: https://codereview.chromium.org/938943002
2015-02-19 08:24:16 -08:00
reed
4675819b9d notify resource caches when pixelref genID goes stale
BUG=skia:

Review URL: https://codereview.chromium.org/825263005
2015-02-19 08:22:54 -08:00
bsalomon
8718aafec2 Rename GrContentKey to GrUniqueKey
Review URL: https://codereview.chromium.org/940463006
2015-02-19 07:24:21 -08:00
kkinnunen
297aaf97a3 Avoid wrong memory access due to double substitution and %%
Use the form SkDebugf("%s", arbitraryString) instead of
SkDebugf(arbitraryString).

Fixes the case where SkString::appendf-ing a string with "%%" and then
printing the string with SkDebugf would cause uninitialized read and
corrupted debug print.

ninja -C out/Debug tools && valgrind --leak-check=full
./out/Debug/render_pictures --config gpu  -w q -r ...

...

==7307== Conditional jump or move depends on uninitialised value(s)
==7307==    at 0x6908475: __printf_fp (printf_fp.c:1180)
==7307==    by 0x6904267: vfprintf (vfprintf.c:1629)
==7307==    by 0x6906E53: buffered_vfprintf (vfprintf.c:2313)
==7307==    by 0x690188D: vfprintf (vfprintf.c:1316)
==7307==    by 0x67E8F5: SkDebugf(char const*, ...) (SkDebug_stdio.cpp:18)
==7307==    by 0x7983F1: GrContext::printCacheStats() const (GrTest.cpp:54)
==7307==    by 0x408ECF: tool_main(int, char**) (render_pictures_main.cpp:480)
==7307==    by 0x40913E: main (render_pictures_main.cpp:511)
==7307==
Budget: 2048 items 100663296 bytes
		Entry Count: current 652 (651 budgeted, 0 wrapped, 297 locked, 638 scratch 32 0.000000ull), high 652
		Entry Bytes: current 51087658 (budgeted 49826658, 49 0.000000ull, 1261000 unbudgeted) high 51087658

(observe "ull" instead of "% full")

(from mtklein)
This CL is not editing public API.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/943453002
2015-02-19 06:32:12 -08:00
halcanary
1b5c604d9d PDF: Add (low-memory) SkPDFBitmap class
Also: Add SkDeflateWStream and associated unit tests.

SkPDFBitmap is a replacement for SkPDFImage.  As of now, it only
supports 8888 bitmaps (the most common case).

SkPDFBitmap takes very little extra memory (aside from refing the
bitmap's pixels), and its emitObject() does not cache any data.

The SkPDFBitmap::Create function will check the canon for duplicates.
This can reduce the size of the output PDF.

Motivation:  this gives another ~40% decrease in PDF memory overhead

TODO: Support other ColorTypes and scrap SkPDFImage.

BUG=skia:3030

Review URL: https://codereview.chromium.org/918813002
2015-02-18 11:29:57 -08:00
halcanary
91d1d621de zlib/pdf: remove HaveFlate(), depend on preprocessor defines
Review URL: https://codereview.chromium.org/933523007
2015-02-17 14:43:06 -08:00
mtklein
1e4e814c03 SK_NO_FLATE
Also remove skia_zlib_static.  We're not using it.  We don't even have zlib in DEPS.

No public API changes.
TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/936583002
2015-02-17 13:10:43 -08:00
egdaniel
305a8897cd Decrease number of allowed stages for Angle on GLProgramTest
BUG=skia:3435

Review URL: https://codereview.chromium.org/931783003
2015-02-17 11:18:38 -08:00
djsollen
50da1d8c3b Fix broken build due to updated #define
TBR=scroggo@google.com

Review URL: https://codereview.chromium.org/934803003
2015-02-17 09:09:53 -08:00
djsollen
523cda3943 Remove android specific srcPath from SkPath
Review URL: https://codereview.chromium.org/926693002
2015-02-17 08:06:33 -08:00
bungeman
3d47e2133c Labels when dumping fonts in Android parser test.
When the FontConfigParserAndroid test runs, it optionally dumps the
configurations it creates for manual inspection. This is useful, but
since three different configurations exist, it can be difficult to tell
them apart. This simply prints a short header before each dump so that
the dump can be identified.

Review URL: https://codereview.chromium.org/927533004
2015-02-13 18:30:11 -08:00
joshualitt
43466a1ade Multi-string shaders
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/1c3c2d83364ee228e0751df0e1b9c161c0ba8c1e

Review URL: https://codereview.chromium.org/929503002
2015-02-13 17:18:27 -08:00
joshualitt
b8a82f2bce Revert of Multi-string shaders (patchset #4 id:60001 of https://codereview.chromium.org/929503002/)
Reason for revert:
windows warnings

Original issue's description:
> Multi-string shaders
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/1c3c2d83364ee228e0751df0e1b9c161c0ba8c1e

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

Review URL: https://codereview.chromium.org/924973002
2015-02-13 16:31:46 -08:00
joshualitt
1c3c2d8336 Multi-string shaders
BUG=skia:

Review URL: https://codereview.chromium.org/929503002
2015-02-13 16:23:49 -08:00
halcanary
3a6672ae0c C++11 Unit Test for RValue semantics.
Motivation:  test that these works on all possible bots and for all possible clients (clients do run these unit tests, right?)

Dear clients:  if this unit test fails, let us know!

BUG=skia:3427

Review URL: https://codereview.chromium.org/922043004
2015-02-13 15:12:52 -08:00
reed
694b0d115d fix more tricky-float cases in SkRRect validate
BUG=458524,458522

Review URL: https://codereview.chromium.org/921163003
2015-02-13 14:33:02 -08:00
bsalomon
3582d3ee9f Split out methods in GrGpuResource::CacheAccess that can be called outside of the cache.
Review URL: https://codereview.chromium.org/923143002
2015-02-13 14:20:05 -08:00
scroggo
0864908ca5 Make SkImageGenerator::getPixels() return an enum.
The new enum describes the nature of the failure. This is in
preparation for writing a replacement for SkImageDecoder, which will
use this interface.

Update the comments for getPixels() to specify what it means to pass
an SkImageInfo with a different size.

Make SkImageGenerator Noncopyable.

Leave onGetYUV8Planes alone, since we have separate discussions
regarding modifying that API.

Make callers of SkImageDecoder consistently handle kPartialSuccess.
Previously, some callers considered it a failure, and others considered
it a success.

BUG=skia:3257

Review URL: https://codereview.chromium.org/919693002
2015-02-13 11:13:34 -08:00
bsalomon
3555bd88a6 Add a templated priority queue class.
Review URL: https://codereview.chromium.org/914003004
2015-02-13 11:08:21 -08:00
ajuma
8e8c940ee3 Fix leak in ComposedImageFilterOffset test
This fixes a leak in the ComposedImageFilterOffset test that was
introduced in https://codereview.chromium.org/908273002/.

BUG=chromium:453924

Review URL: https://codereview.chromium.org/922063005
2015-02-13 10:15:46 -08:00
ajuma
5788faaa2a Fix SkComposeImageFilter's bounds computation and offset handling
This makes SkComposeImageFilter::computeFastBounds compose its
filters' bounds (rather than falling back to
SkImageFilter::computeFastBounds, which takes the union of the bounds).

This also makes SkComposeImageFilter::onFilterImage correctly handle
an offset produced when applying the inner filter; such offsets were
previously ignored.

BUG=chromium:453924

Review URL: https://codereview.chromium.org/908273002
2015-02-13 09:05:47 -08:00
egdaniel
e36914cb20 Pass in ProcOptInfos into willNeedDstCopy on XPs
BUG=skia:

Review URL: https://codereview.chromium.org/912413002
2015-02-13 09:00:33 -08:00
bungeman
9a0808fd8e Verify all parsed test font files start with cap.
All of the Android test font configuration files have file names which
start with a capital latin letter. Verify this is true of the parsed file
names. This would have caught previous issues with slicing, and will
hopefully prevent such issues going unnoticed in the future.

Review URL: https://codereview.chromium.org/925933003
2015-02-13 08:55:16 -08:00
fmalita
79ca081b90 Minimize SkTHash object copying
AKA ref-constify the world.

R=mtklein@google.com

Review URL: https://codereview.chromium.org/919193002
2015-02-12 17:32:49 -08:00
Mike Klein
201c98d08d fix windows build
BUG=skia:

Review URL: https://codereview.chromium.org/917363002
2015-02-12 16:41:57 -05:00
mtklein
979e0eacbd Spin off SkTHashTable, SkTHashMap, SkTHashSet
SkTHashTable is very similar to SkTDynamicHash, except it's generalized to support non-pointer value types.

It doesn't support remove(), just to keep things simple (it's not hard to add).
Instead of an iterator, it has foreach(), again, to keep things simple.

SkTHashMap<K,V> and SkTHashSet<T> build a friendlier experience on top of SkTHashTable.

BUG=skia:

Review URL: https://codereview.chromium.org/925613002
2015-02-12 13:20:08 -08:00
robertphillips
2de5939115 Revert of Fix Chromium build (patchset #2 id:20001 of https://codereview.chromium.org/916763003/)
Reason for revert:
Chrome

Original issue's description:
> Fix Chromium build
>
> TBR=jvanverth@google.com
>
> Committed: https://skia.googlesource.com/skia/+/f5e89c8f685ac8a5c4d117e087b4111d613106db

TBR=jvanverth@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/916963002
2015-02-11 13:18:14 -08:00
robertphillips
f5e89c8f68 Fix Chromium build
TBR=jvanverth@google.com

Review URL: https://codereview.chromium.org/916763003
2015-02-11 11:38:44 -08:00
bsalomon
0ea80f43a1 Rename GrResourceCache2->GrResourceCache
TBR=robertphillips@google.com

Review URL: https://codereview.chromium.org/921453002
2015-02-11 10:49:59 -08:00
bungeman
c3c694342a Fix append_fallback_font_families_for_locale.
The language was being set to garbage, now set to part of the file name.
Add a test to ensure we continue to parse fallback directories correctly.

BUG=chromium:422180

Review URL: https://codereview.chromium.org/912053003
2015-02-11 07:18:51 -08:00
bsalomon
3632f8473a Add tests for STArray swap
Review URL: https://codereview.chromium.org/909583003
2015-02-10 19:46:58 -08:00
mtklein
bfd5bff75c Simplify SkBBH::insert API
No one's exploiting the ability to take ownership of the array anymore.

BUG=skia:

Review URL: https://codereview.chromium.org/913833002
2015-02-10 13:44:27 -08:00
halcanary
bf799cd228 Simplify reference management in SkPDF
Prior to this change, SkPDFObject subclasses were required
to track their resources separately from the document
structure.  (An object has a resource if it depends, via an
indirect reference, on another object).  This led to a lot
of extra code to duplicate effort.  I replace the
getResources() function with the much simpler addResources()
function.  I only define a non-trivial addResources() method
on arrays, dictionaries, and indirect object references.
All other specialized classes simply rely on their parent
class's implementation.

SkPDFObject::addResources() works by recursively walking the
directed graph of object (direct and indirect) references
and adding resources to a set.  It doesn't matter that there
are closed loops in the graph, since we check the set before
walking down a branch.

-  Add SkPDFObject::addResources() virtual function, with
   four implementations
-  Remove SkPDFObject::getResources() virtual function and
   all implementations.
-  Remove SkPDFObject::GetResourcesHelper()
-  Remove SkPDFObject::AddResourceHelper()
-  In SkPDFCatalog::findObjectIndex(), add an object to the
   catalog if it doesn't exist yet.
-  SkPDFCatalog::setSubstitute() no longer sets up resources
-  SkPDFDocument.cpp no longer needs the Streamer object
-  SkPDFDocument.cpp calls fDocCatalog->addResources to build
   the resource list.
-  SkPDFFont::addResource() removed
-  All SkPDF-::fResource sets removed (they are redundant).
-  removed SkPDFImage::addSMask() function
-  SkPDFResourceDict::getReferencedResources() removed.

Motivation: this removes quite a bit of code and makes the
objects slightly slimmer in memory.  Most importantly, this
will lead the way towards removing SkPDFObject's inheritance
from SkRefCnt, which will greatly simplify everything.

Testing: I usually test changes to the PDF backend by
comparing checksums of PDF files rendered from GMs and SKPs
before and after the change.  This change both re-orders and
re-numbers the indirect PDF objects.  I used the qpdf
program to normalize the PDFs and then compared the
normalized outputs from before and after the change; they
matched.

Review URL: https://codereview.chromium.org/870333002
2015-02-10 13:32:09 -08:00
reed
454fa71cc3 check for nonfinites in rrects
BUG=457128

Review URL: https://codereview.chromium.org/913743002
2015-02-10 08:46:22 -08:00
bungeman
eb2be7fa44 Additional cleanups to Android config parsing.
Properly labels several methods as static.
Use XML_GetBuffer to avoid an extra copy.
Set the memory allocators to Skia's.
Set define in 'defines' instead of cflags.
Update debug dumper.

Review URL: https://codereview.chromium.org/915443002
2015-02-10 07:51:12 -08:00
reed
d5d27d9b14 use conics for arcTo
guarded by SK_SUPPORT_LEGACY_ARCTO_QUADS

BUG=skia:

Review URL: https://codereview.chromium.org/892703002
2015-02-09 13:54:43 -08:00
reed
31223e0cb7 cull edges that are to the right of the clip
BUG=skia:

Review URL: https://codereview.chromium.org/913503002
2015-02-09 08:33:07 -08:00
bsalomon
23e619cf46 Reimplement gpu message bus for invalidated bitmap gen IDs
Review URL: https://codereview.chromium.org/902873002
2015-02-06 11:54:28 -08:00
bsalomon
d0423587ac One createTexture function, attempt to recycle scratch in createTexture.
Review URL: https://codereview.chromium.org/864383003
2015-02-06 08:49:24 -08:00
bungeman
7fa87cd09f Add factory for Android font manager.
This allows users to create an Android font manager with their own set
of fonts, or augment the system set. This will allow for removal of
the current globals which are used for a similar, but more constained,
purpose.

BUG=skia:2817,skia:3314,chromium:407340

Review URL: https://codereview.chromium.org/887113002
2015-02-06 07:59:19 -08:00
bsalomon
50785a3d10 Revert of Revert of Move DstCopy on gpu into the GrXferProcessor. (patchset #1 id:1 of https://codereview.chromium.org/901663007/)
Reason for revert:
The revert didn't help the 10.9 bot. Unreverting by reverting the revert (which is basically relanding the original patch which itself was a revert of a revert). Revert.

Original issue's description:
> Revert of Move DstCopy on gpu into the GrXferProcessor. (patchset #11 id:200001 of https://codereview.chromium.org/885923002/)
>
> Reason for revert:
> Testing to see if reverting fixes 10.9 bots.
>
> Original issue's description:
> > Move DstCopy on gpu into the GrXferProcessor.
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/74a11753604768bf461b80cabb66060e8564d82c
> >
> > Committed: https://skia.googlesource.com/skia/+/5e1378d0e075a323144ba14e0a4cbcca35eccc69
>
> TBR=joshualitt@google.com,egdaniel@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/21b2c53218ab25f4268e3992e51d916076a2a7ee

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

Review URL: https://codereview.chromium.org/873723009
2015-02-06 07:02:37 -08:00
bsalomon
21b2c53218 Revert of Move DstCopy on gpu into the GrXferProcessor. (patchset #11 id:200001 of https://codereview.chromium.org/885923002/)
Reason for revert:
Testing to see if reverting fixes 10.9 bots.

Original issue's description:
> Move DstCopy on gpu into the GrXferProcessor.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/74a11753604768bf461b80cabb66060e8564d82c
>
> Committed: https://skia.googlesource.com/skia/+/5e1378d0e075a323144ba14e0a4cbcca35eccc69

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

Review URL: https://codereview.chromium.org/901663007
2015-02-05 14:18:05 -08:00
egdaniel
5e1378d0e0 Move DstCopy on gpu into the GrXferProcessor.
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/74a11753604768bf461b80cabb66060e8564d82c

Review URL: https://codereview.chromium.org/885923002
2015-02-05 11:11:13 -08:00
joshualitt
de358a9946 BUG=skia:
Review URL: https://codereview.chromium.org/894693003
2015-02-05 08:19:35 -08:00
egdaniel
4dce32c466 Revert "Move DstCopy on gpu into the GrXferProcessor."
This reverts commit 74a1175360.

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

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

Review URL: https://codereview.chromium.org/896163003
2015-02-04 06:25:28 -08:00
egdaniel
7adb355594 Revert of Revert "Move DstCopy on gpu into the GrXferProcessor." (patchset #1 id:1 of https://codereview.chromium.org/896163003/)
Reason for revert:
failed on my manual revert

Original issue's description:
> Revert "Move DstCopy on gpu into the GrXferProcessor."
>
> This reverts commit 74a1175360.
>
> TBR=joshualitt@google.com,bsalomon@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/3e9dfdb3784c0cbfecf7589a74aa9aff7ef40abd

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

Review URL: https://codereview.chromium.org/900913002
2015-02-04 06:20:25 -08:00
egdaniel
3e9dfdb378 Revert "Move DstCopy on gpu into the GrXferProcessor."
This reverts commit 74a1175360.

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

Review URL: https://codereview.chromium.org/896163003
2015-02-04 06:14:22 -08:00
egdaniel
74a1175360 Move DstCopy on gpu into the GrXferProcessor.
BUG=skia:

Review URL: https://codereview.chromium.org/885923002
2015-02-03 15:02:43 -08:00
bsalomon
37f9a2694c Move npot resizing out of GrContext and simplify GrContext texture functions.
Committed: https://skia.googlesource.com/skia/+/8a8100349105c8c6de39fcb34e47679da7a67f54

Committed: https://skia.googlesource.com/skia/+/6c96672491b04cb782bce8fee778124df66524a0

Review URL: https://codereview.chromium.org/882223003
2015-02-02 13:00:10 -08:00
rmistry
465206af18 Add missing SK_OVERRIDE
Tested by running on clang head + ubuntu 14.04:
GYP_DEFINES=”skia_gpu=0 skia_warnings_as_errors=1" tools/xsan_build thread dm BUILDTYPE=Release
out/Release/dm -v

BUG=skia:3386

Review URL: https://codereview.chromium.org/894833002
2015-02-02 12:08:18 -08:00
bsalomon
e137db8569 Revert of Move npot resizing out of GrContext and simplify GrContext texture functions. (patchset #10 id:200001 of https://codereview.chromium.org/882223003/)
Reason for revert:
perf fix didn't fix the cr webgl conformance tests

Original issue's description:
> Move npot resizing out of GrContext and simplify GrContext texture functions.
>
> Committed: https://skia.googlesource.com/skia/+/8a8100349105c8c6de39fcb34e47679da7a67f54
>
> Committed: https://skia.googlesource.com/skia/+/6c96672491b04cb782bce8fee778124df66524a0

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

Review URL: https://codereview.chromium.org/887303002
2015-01-31 20:10:56 -08:00
bsalomon
6c96672491 Move npot resizing out of GrContext and simplify GrContext texture functions.
Committed: https://skia.googlesource.com/skia/+/8a8100349105c8c6de39fcb34e47679da7a67f54

Review URL: https://codereview.chromium.org/882223003
2015-01-31 19:27:53 -08:00
fmalita
6bfef2dfec Revert of Move npot resizing out of GrContext and simplify GrContext texture functions. (patchset #9 id:160001 of https://codereview.chromium.org/882223003/)
Reason for revert:
webGL conformance failures:

WebglConformance.conformance_textures_tex_image_and_sub_image_2d_with_video
WebglConformance.conformance_textures_texture_npot_video

https://codereview.chromium.org/892773003/
http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/29272

Original issue's description:
> Move npot resizing out of GrContext and simplify GrContext texture functions.
>
> Committed: https://skia.googlesource.com/skia/+/8a8100349105c8c6de39fcb34e47679da7a67f54

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

Review URL: https://codereview.chromium.org/868233005
2015-01-31 07:02:18 -08:00
bungeman
a44e9b9842 Update dump code in FontConfigParser test.
This code is still quite useful for debugging, but has bit rotted.
Update to match current structure of code.

Review URL: https://codereview.chromium.org/890073002
2015-01-30 19:58:19 -08:00
bsalomon
8a81003491 Move npot resizing out of GrContext and simplify GrContext texture functions.
Review URL: https://codereview.chromium.org/882223003
2015-01-30 12:43:44 -08:00
mtklein
4f358fc269 Make SkWriter32::snapshotAsData() a dumb copy.
SkWriter32::snapshotAsData() is no longer performance critical.
It's only used when we're serializing to disk.

BUG=skia:2289

Review URL: https://codereview.chromium.org/875403005
2015-01-29 12:03:53 -08:00
scroggo
648238cc90 Remove SkProxyCanvas.
SkProxyCanvas is redundant with SkNWayCanvas, and means another class
we have to keep in sync with the SkCanvas interface.

Remove tests which use an SkProxyCanvas.

Requires a change to chromium.

BUG=skia:3279
BUG=skia:500

Review URL: https://codereview.chromium.org/886813002
2015-01-29 11:58:51 -08:00
caryclark
52ee813990 fix parsing SVG strings to paths with comma delimiters
BUG=skia:583
R=reed@google.com

Review URL: https://codereview.chromium.org/885103002
2015-01-29 09:45:44 -08:00
reed
9d91eb3136 add more checks for computing clamp counts, remove dead code
BUG=448299

Review URL: https://codereview.chromium.org/886473003
2015-01-28 11:44:48 -08:00
bungeman
5f213d9627 SkTypeface to use SkStreamAsset.
SkTypeface already requires typeface streams to support SkStreamAsset
in practice, and in practice all users are already supplying them.

Review URL: https://codereview.chromium.org/869763002
2015-01-27 05:39:10 -08:00
robertphillips
98b0315ad6 Alter gpu veto
This CL unifies the treatment of the dashed and concave paths.

Before:
TP 28 FP 15 TN 8 FN 3 IND 3

After:
TP 28 FP 18 TN 7 FN 2 IND 2

One of the TrueNegatives that became a FalsePositive was the motivation use case (the Chromium busy spinner).

Committed: https://skia.googlesource.com/skia/+/87a6a8e18c7d5bbc94f478b44c53dc0e0549f927

Review URL: https://codereview.chromium.org/875913002
2015-01-26 11:29:36 -08:00
kkinnunen
dc0f408a96 Fold alpha to the inner savelayer in savelayer-savelayer-restore patterns
Fold alpha to the inner savelayer in savelayer-savelayer-restore
patterns such as this:

  SaveLayer (non-opaque)
    Save
      ClipRect
      SaveLayer
      Restore
    Restore
  Restore

Current blink generates these for example for SVG content such as this:

<path style="opacity:0.5 filter:url(#blur_filter)"/>

The outer save layer is due to the opacity and the inner one is due to
blur filter being implemented with picture image filter.

Reduces layers in desk_carsvg.skp testcase from 115 to 78.

BUG=skia:3119

Review URL: https://codereview.chromium.org/835973005
2015-01-26 00:14:26 -08:00
mtklein
31ff29829e Don't leak image in Surface test.
==7023== 5,056 (896 direct, 4,160 indirect) bytes in 8 blocks are definitely lost in loss record 947 of 2,656
==7023==    at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7023==    by 0x82CB99: SkNewImageFromBitmapTexture(SkBitmap const&, int, SkSurface::Budgeted) (SkImage_Gpu.cpp:64)
==7023==    by 0x81A1CF: SkSurface_Gpu::onNewImageSnapshot(SkSurface::Budgeted) (SkSurface_Gpu.cpp:50)
==7023==    by 0x694F9D: SkSurface::newImageSnapshot(SkSurface::Budgeted) (SkSurface_Base.h:92)
==7023==    by 0x55EA7C: test_Surface(skiatest::Reporter*, GrContextFactory*) (SurfaceTest.cpp:485)
==7023==    by 0x407CB2: run_test(skiatest::Test*) (DM.cpp:399)
==7023==    by 0x408382: run_enclave_and_gpu_tests(SkTArray<Task, false>*) (DM.cpp:411)
==7023==    by 0x68B71E: SkTaskGroup::wait() (SkTaskGroup.cpp:67)
==7023==    by 0x40934E: dm_main() (DM.cpp:455)
==7023==    by 0x409483: main (DM.cpp:477)

http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind/builds/276/steps/dm/logs/stdio

TBR=bsalomon@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/872183002
2015-01-24 11:27:27 -08:00
yunchao.he
90acb8e97c a typo in SkResourceCacheTest
BUG=skia:

Review URL: https://codereview.chromium.org/868613002
2015-01-23 17:06:21 -08:00
bsalomon
63c992f6c0 Fix the speeling of "purgeable" in Gr code
TBR=robertphillips@google.com

Review URL: https://codereview.chromium.org/874693002
2015-01-23 12:47:59 -08:00
halcanary
6a144345d7 Cleanup SkPDFObject::emit*
Review URL: https://codereview.chromium.org/869783003
2015-01-23 11:45:10 -08:00
bsalomon
eaaaf0b16c Take budgeted param when snapping new image.
Review URL: https://codereview.chromium.org/872543002
2015-01-23 08:08:04 -08:00
reed
2ff257bd95 check for too-large rowBytes
BUG=446164

Review URL: https://codereview.chromium.org/871993003
2015-01-23 07:51:14 -08:00
bsalomon
c2f35b750a Allow unbudgeted resources to be recycled by the cache as scratch.
Review URL: https://codereview.chromium.org/870743002
2015-01-23 07:19:22 -08:00
bsalomon
1ea1ebce10 Remove GrBinHashKey
Review URL: https://codereview.chromium.org/861323002
2015-01-23 06:46:16 -08:00
mtklein
2f6bb6b852 minor readability / refactors
I have been hacking at this test trying to understand why the N5 is
still sometimes crashy (it seems, less but not zero now). No luck so far.

But, while I've been reading and hacking at it, I think I've made a
few small improvements, mostly to readability.

BUG=skia:

Review URL: https://codereview.chromium.org/870803002
2015-01-23 05:47:55 -08:00
bsalomon
24db3b1c35 Add specialized content key class for resources.
Review URL: https://codereview.chromium.org/858123002
2015-01-23 04:24:05 -08:00
mtklein
cada95ad9b Move FP texture test buffers to heap.
This is a speculative fix for the crashing N5 bots.  It looks like the bots are
always failing in or around FloatingPointTextureTest.

It looks like sometimes they're hitting a SIGBUS, which I suspect is stack
overflow.  FloatingPointTextureTest allocates ~320K on the stack, which may
be too much.  This CL moves those buffers to the heap.  For consistency I did
the same with the half-float tests, though they're only using ~1/8th the stack.

It looks like sometimes the bots are failing to malloc.  I don't understand that,
and this CL doesn't address that directly.  But it's possible this is still a stack
overflow, just trashing RAM and causing arbitrary mayhem instead of a SIGBUS.

I have no idea why this is a problem only on the N5.  I have been unable to
reproduce this locally, neither with a K N5 nor an L N5, but the bots are pretty
reliable.

NOTREECHECKS=true
BUG=skia:

Review URL: https://codereview.chromium.org/871623002
2015-01-22 13:50:35 -08:00
egdaniel
8dd688b756 Rename GrOptDrawState to GrPipeline and GrDrawState to GrPipelineBuilder
BUG=skia:

Review URL: https://codereview.chromium.org/858343002
2015-01-22 10:16:09 -08:00
reed
e44acc9617 remove more dead code
BUG=skia:

Review URL: https://codereview.chromium.org/865873003
2015-01-22 09:37:46 -08:00
reed
b0dfb546f5 remove (unused) GatherPixelRefs
BUG=skia:

Review URL: https://codereview.chromium.org/869463002
2015-01-22 09:03:25 -08:00
scroggo
a1193e4b0e Make SkStream *not* ref counted.
SkStream is a stateful object, so it does not make sense for it to have
multiple owners. Make SkStream inherit directly from SkNoncopyable.

Update methods which previously called SkStream::ref() (e.g.
SkImageDecoder::buildTileIndex() and SkFrontBufferedStream::Create(),
which required the existing owners to call SkStream::unref()) to take
ownership of their SkStream parameters and delete when done (including
on failure).

Switch all SkAutoTUnref<SkStream>s to SkAutoTDelete<SkStream>s. In some
cases this means heap allocating streams that were previously stack
allocated.

Respect ownership rules of SkTypeface::CreateFromStream() and
SkImageDecoder::buildTileIndex().

Update the comments for exceptional methods which do not affect the
ownership of their SkStream parameters (e.g.
SkPicture::CreateFromStream() and SkTypeface::Deserialize()) to be
explicit about ownership.

Remove test_stream_life, which tested that buildTileIndex() behaved
correctly when SkStream was a ref counted object. The test does not
make sense now that it is not.

In SkPDFStream, remove the SkMemoryStream member. Instead of using it,
create a new SkMemoryStream to pass to fDataStream (which is now an
SkAutoTDelete).

Make other pdf rasterizers behave like SkPDFDocumentToBitmap.

SkPDFDocumentToBitmap delete the SkStream, so do the same in the
following pdf rasterizers:

SkPopplerRasterizePDF
SkNativeRasterizePDF
SkNoRasterizePDF

Requires a change to Android, which currently treats SkStreams as ref
counted objects.

Review URL: https://codereview.chromium.org/849103004
2015-01-21 12:09:53 -08:00
joshualitt
17e7314e0e remove drawtype
BUG=skia:

Review URL: https://codereview.chromium.org/862933005
2015-01-21 11:52:36 -08:00
joshualitt
b77e4b6bf0 remove drawType from optState
BUG=skia:

Review URL: https://codereview.chromium.org/864853002
2015-01-21 10:16:18 -08:00
bsalomon
1c60dfe7ca Reland https://codereview.chromium.org/860333002 with fix for test failures.
Revert "Revert of Make GrScratchKey memory buffer correct size on copy (patchset #1 id:1 of https://codereview.chromium.org/860333002/)"

This reverts commit 988018c817.

BUG=skia:

Review URL: https://codereview.chromium.org/863983003
2015-01-21 09:32:40 -08:00
mtklein
988018c817 Revert of Make GrScratchKey memory buffer correct size on copy (patchset #1 id:1 of https://codereview.chromium.org/860333002/)
Reason for revert:
Our Valgrind bot just spewed out a weird error.  I don't know if it's related, but it looks at least like one of the stacks was in the right area, so I'm going to revert this precautionarily.  Sorry if this is a false positive.

http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind/builds/266/steps/dm/logs/stdio

Original issue's description:
> Make GrScratchKey memory buffer correct size on copy
>
> Scratch key memory buffer of a copy of a key was too big. The (new) copy
> was N times uint32_t bytes instead of N bytes.
>
> Adds few tests to resource cache. These tests would not catch the too
> big buffer. This is just a precaution for too small buffers. The main
> idea of the test change is that the scratch key should contain some
> information, so that lookup with a scratch key can also return no
> match. Otherwise testing of scratch lookup result is not indicative of
> correct code (eg. no-information scratch key will always match).
>
> Committed: https://skia.googlesource.com/skia/+/711ef4831363fb8cbdf061dc2c36c65b13c0ccf2

TBR=bsalomon@google.com,kkinnunen@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/864833003
2015-01-21 08:05:55 -08:00
kkinnunen
711ef48313 Make GrScratchKey memory buffer correct size on copy
Scratch key memory buffer of a copy of a key was too big. The (new) copy
was N times uint32_t bytes instead of N bytes.

Adds few tests to resource cache. These tests would not catch the too
big buffer. This is just a precaution for too small buffers. The main
idea of the test change is that the scratch key should contain some
information, so that lookup with a scratch key can also return no
match. Otherwise testing of scratch lookup result is not indicative of
correct code (eg. no-information scratch key will always match).

Review URL: https://codereview.chromium.org/860333002
2015-01-21 06:39:14 -08:00
reed
3f43f8ab9c remove dead SkPersp macros
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/864713002
2015-01-20 19:58:36 -08:00
halcanary
87f3ba4847 Simplify skiatest framework.
skiatest::Test class is now a simple struct.  Some
functionalty, such as counting errors or timing is now
handled elsewhere.

skiatest:Reporter is now a simpler abstract class.  The two
implementations handle test errors.

DM and pathops_unittest updated.

Review URL: https://codereview.chromium.org/830513004
2015-01-20 09:30:20 -08:00
joshualitt
873ad0e0b4 BUG=skia:
Review URL: https://codereview.chromium.org/815643005
2015-01-20 09:08:52 -08:00
egdaniel
71e236c03e Remove willReadDst from GrFragmentProcessor.
Since only XP's can read dst now, there is no reason to have this query on GrFP.
This also triggered a chain reaction of cleaning up/removing unnecessary code
elsewhere.

BUG=skia:

Review URL: https://codereview.chromium.org/851143003
2015-01-20 06:34:51 -08:00
sugoi
692135f968 YUV planes cache
- Added new classes to contain YUV planes of memory, along with the associated data.
- Used these classes in load_yuv_texture() to enable YUV planes caching
- Added a unit test for the new cache

BUG=450021

Review URL: https://codereview.chromium.org/851273003
2015-01-19 10:10:27 -08:00
bsalomon
afe3005be3 Require budget decision when creating a RenderTarget SkSurface.
Restructure SkGpuDevice creation:
*SkSurfaceProps are optional.
*Use SkSurfaceProps to communicate DF text rather than a flag.
*Tell SkGpuDevice::Create whether RT comes from cache or not.

Review URL: https://codereview.chromium.org/848903004
2015-01-16 07:32:33 -08:00
caryclark
45fa447460 new files for pathops geometric intersection
There's no gyp references to these new files,
so this should only have the effect of reducing
the size of the commit that turns this code on.

TBR=

Review URL: https://codereview.chromium.org/853223002
2015-01-16 07:04:10 -08:00
kkinnunen
678c1b019a Fold alpha to the draw in savelayer-draw-restore patterns with non-opaque draw
Fold alpha of a save layer call to the subsequent draw call paint, even when
the draw call paint color is already non-opaque.

Comparing the difference of the unoptimized and the optimized call pattern
with all (layer alpha, draw alpha) combinations, this produces
off-by-one pixels ~50% of the time.

Reduces layers of current desk_carsvg.skp (recorded with cross-process
picture image filters allowed) from 122 to 115.

BUG=skia:3119

Review URL: https://codereview.chromium.org/840483005
2015-01-16 05:04:36 -08:00
mtklein
0c278972d0 Why are we afraid of saveLayer() bounds?
They're only hints.  We can ignore them in this optimization.
My only hesitation is that this pattern doesn't seem to happen in our .skps.

BUG=skia:

Review URL: https://codereview.chromium.org/849243002
2015-01-15 08:08:10 -08:00
fmalita
1a178ca6dd Use device-space stroke width for SkDraw::drawRect() quick-reject
The stroke width needs to be CTM-adjusted when applied to device space
rects.

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

Review URL: https://codereview.chromium.org/801353008
2015-01-15 06:01:23 -08:00
bsalomon
5236cf480d Make uncached textures uncached from the get go.
This avoids the problem of a newly created uncached texture causing a purge of cached resources.

BUG=chromium:445885

Review URL: https://codereview.chromium.org/846303002
2015-01-14 10:42:08 -08:00
mtklein
7c348a8097 DM can see into src/gpu. No need for relative include.
BUG=skia:

Review URL: https://codereview.chromium.org/853613004
2015-01-14 09:25:01 -08:00
mtklein
2c0e8f13a0 Remove self-assignment in a test.
BUG=skia:

Review URL: https://codereview.chromium.org/853723002
2015-01-14 08:49:10 -08:00
joshualitt
71c9260e6f More changes to bring together path / geo procs
BUG=skia:

Review URL: https://codereview.chromium.org/820783005
2015-01-14 08:12:47 -08:00
mtklein
199ba8e19b namespace {} trick for SK_DECLARE_STATIC_ONCE
Like all our other SK_DECLARE_STATIC_*, it's usually not a thread-safe
thing to put inside a function.  Adding namespace {} prevents that
syntactically.

Needs https://codereview.chromium.org/841263004/ to land first.

BUG=chromium:447890

No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/806473006
2015-01-13 08:40:23 -08:00
mtklein
6f07665768 Simplify SkInstCnt
This code requires fewer macros to use it (just one), has less code in macro
definitions, and has simpler synchronization code (just atomic ints, no SkOnce,
no SkMutex, etc.)

A minor downside, we lose indentation and reverse-ordering in the final report:
  Leaked SkRefCntBase: 7
     Leaked SkFontMgr: 1
     Leaked SkWeakRefCnt: 1
         Leaked SkTypeface: 1
     Leaked SkFlattenable: 3
         Leaked SkXfermode: 3
     Leaked SkPathRef: 1
     Leaked SkPixelRef: 1
         Leaked SkMallocPixelRef: 1
becomes
  Leaked SkXfermode: 3
  Leaked SkMallocPixelRef: 1
  Leaked SkPixelRef: 1
  Leaked SkPathRef: 1
  Leaked SkFlattenable: 3
  Leaked SkTypeface: 1
  Leaked SkWeakRefCnt: 1
  Leaked SkFontMgr: 1
  Leaked SkRefCntBase: 7

This is motivated by wanting to land https://codereview.chromium.org/806473006/,
which makes sure all static use of SkOnce are in global scope.  The current
implementation of SkInstCnt uses them in function scope, which isn't safe.
BUG=skia:

No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/841263004
2015-01-13 08:22:44 -08:00
halcanary
f361b71439 In SkPDFDocument::emitPDF(), stop pre-calculating file offsets.
* Add Streamer utility class which measures the current
  pdf offset by calling SkWStream::bytesWritten(). Calls
  SkPDFCatalog::setFileOffset() and SkPDFObject::emit() at
  the same time to guarantee that everything works out.

* SkPDFCatalog::setFileOffset() no longer calculates the
  object's size.

* SkPDFCatalog::setSubstituteResourcesOffsets() removed.

* SkPDFCatalog::emitSubstituteResources() removed and
  getSubstituteList() made public in its place.

* Remove SkPDFPage::getPageSize and SkPDFPage::emitPage.
  Replace with SkPDFPage::getContentStream().

* SkPDFObject::getOutputSize no longer virtual, only used in
  unit tests.  All SkPDFObject subclasses getOutputSize()
  overrides removed.

* SkPDFObject::getIndirectOutputSize removed.

* PDFPrimitivesTest updated for new functions.

Review URL: https://codereview.chromium.org/846023003
2015-01-13 07:12:57 -08:00
halcanary
4fc48af0d7 Change function signature of SkPDFObject::emitObject.
Replace virutal SkPDFObject::emitObject(s, c, true) with non-virtual
SkPDFObject::emitIndirectObject(s, c), since none of the subclasses do
(or should do) anything different.

Replace object->emitObject(s, c, false) with object->emitObject(s, c)

This is one step in simplifying the SkPDFObject interface to allow for
the next step in refactoring.

Review URL: https://codereview.chromium.org/827733004
2015-01-12 10:07:50 -08:00
mtklein
72c9faab45 Fix up all the easy virtual ... SK_OVERRIDE cases.
This fixes every case where virtual and SK_OVERRIDE were on the same line,
which should be the bulk of cases.  We'll have to manually clean up the rest
over time unless I level up in regexes.

for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end

BUG=skia:

Review URL: https://codereview.chromium.org/806653007
2015-01-09 10:06:40 -08:00
mtklein
703dd2ed18 Remove SkTileGrid (except for TileGridInfo).
TBR=reed@google.com

BUG=skia:3085

Review URL: https://codereview.chromium.org/845623002
2015-01-09 06:41:48 -08:00
reed
5965c8ae4e add ImageGenerator::NewFromData to porting layer
BUG=skia:3275

Review URL: https://codereview.chromium.org/834633006
2015-01-07 18:04:45 -08:00
mtklein
7e44bb1916 Remove macros that make it look like it's a good idea to not be able to flatten.
There are only a handful of SkFlattenables that are not flattenable.  That
there are any seems highly illogical.  To make this look less like a normal
thing, this removes both macros that marked SkFlattenables as non-flattenable
(in slightly different ways).

The handful of SkFlattenables in our codebase that can't be flattened now
assert violently that they can't be flattened.  They're internal or
part of animator... places where we'll never actually flatten them.

TestLooper and DummyRasterizer were so trivial that I just made them flattenable.

BUG=skia:

Review URL: https://codereview.chromium.org/841753002
2015-01-07 09:06:08 -08:00
robertphillips
783fe16b8e Rename SkDrawPictureCallback to SkPicture::AbortCallback
Committed: https://skia.googlesource.com/skia/+/7ef197255deb4e2fa64c03c7130d56ddf164e83c

Review URL: https://codereview.chromium.org/829983003
2015-01-07 07:28:41 -08:00
reed
8ea6dabbb1 Revert of Rename SkDrawPictureCallback to SkPicture::AbortCallback (patchset #2 id:20001 of https://codereview.chromium.org/829983003/)
Reason for revert:
speculative revert to unblock DEPS roll

Original issue's description:
> Rename SkDrawPictureCallback to SkPicture::AbortCallback
>
> Committed: https://skia.googlesource.com/skia/+/7ef197255deb4e2fa64c03c7130d56ddf164e83c

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

Review URL: https://codereview.chromium.org/824013004
2015-01-06 16:15:25 -08:00
robertphillips
7ef197255d Rename SkDrawPictureCallback to SkPicture::AbortCallback
Review URL: https://codereview.chromium.org/829983003
2015-01-06 12:26:08 -08:00
robertphillips
c4bd39c903 Require explicit disabling of cross process pictureimagefilters
This is to allow capturing .skp files with their pictureimagefilters intact.

This is a companion to https://codereview.chromium.org/810933004/ (Provide a way of allowing cross process pictureimagefilters).

Review URL: https://codereview.chromium.org/834673006
2015-01-06 09:17:02 -08:00
robertphillips
2b6ab61e22 Remove SkPath::asRect
AFAICT the asRect entry point is not needed.

Greg: GPU
Reed: API
Cary: Path

Review URL: https://codereview.chromium.org/833193002
2015-01-05 12:22:14 -08:00
robertphillips
91b0a35873 Cleanup isRect variants
Review URL: https://codereview.chromium.org/832083002
2015-01-05 10:13:46 -08:00
reed
41af966ab3 Revert of Revert of move remaining virtual draw methods to onDraw (patchset #1 id:1 of https://codereview.chromium.org/835913002/)
Reason for revert:
test to see if it wasn't this CL that broke chromeos

Original issue's description:
> Revert of move remaining virtual draw methods to onDraw (patchset #5 id:80001 of https://codereview.chromium.org/817723005/)
>
> Reason for revert:
> did this cause chromeos heap corruption on skp?
>
> Original issue's description:
> > move remaining virtual draw methods to onDraw
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/2e0f7d53bba5438c9bf11ee5ccae2c301e348419
>
> TBR=robertphillips@google.com,djsollen@google.com,bsalomon@google.com,mtklein@google.com
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/e87e383351e1547b21d96d02bcd0c3cbbe0837f1

TBR=robertphillips@google.com,djsollen@google.com,bsalomon@google.com,mtklein@google.com,reed@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/831253002
2015-01-05 07:49:08 -08:00
mtklein
49aabde6ef Clean up dead clear() code in SkRecord.
This removes the SkRecords::Clear struct and everything that refers to it.
Notice there is nothing actually creating a Clear, which means this is all
dead code.

Now that all ops obey the clip, I don't think we need the weird
inflate-empty-to-epsilon hack for BBH queries.

BUG=skia:

Review URL: https://codereview.chromium.org/835813002
2015-01-05 07:02:45 -08:00
reed
e87e383351 Revert of move remaining virtual draw methods to onDraw (patchset #5 id:80001 of https://codereview.chromium.org/817723005/)
Reason for revert:
did this cause chromeos heap corruption on skp?

Original issue's description:
> move remaining virtual draw methods to onDraw
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/2e0f7d53bba5438c9bf11ee5ccae2c301e348419

TBR=robertphillips@google.com,djsollen@google.com,bsalomon@google.com,mtklein@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/835913002
2015-01-05 04:49:38 -08:00
reed
2e0f7d53bb move remaining virtual draw methods to onDraw
BUG=skia:

Review URL: https://codereview.chromium.org/817723005
2015-01-04 21:09:04 -08:00
reed
c4fda92f45 remove unused drawData
BUG=skia:

Review URL: https://codereview.chromium.org/830083002
2015-01-02 06:39:51 -08:00
reed
b2497c2d94 change API contract: disallow zero-sized images or surfaces
BUG=skia:

Review URL: https://codereview.chromium.org/830033003
2014-12-31 12:31:43 -08:00
bsalomon
7775c85611 Add a simpler key type for scratch resource keys.
BUG=skia:2889

Review URL: https://codereview.chromium.org/815833004
2014-12-30 12:50:52 -08:00
robertphillips
fe7c427e3d Fix bound returned by SkPath::isRect when the path contains a trailing moveTo
Oddly enough this was fixed in:

https://codereview.chromium.org/16950021/ (add rect-output parameter to isRect, allowing us to return the correct bounds even if a rectagular path has a trailing moveTo)

but was reverted here:

https://skia.googlesource.com/skia/+/8fd160350ca5f57fbb1b2e03383c5778414a9b48

since it appeared to be crashing Chrome's trybots. I think it just fell through the cracks after that.

If this sticks I will land a follow on patch for the stroke issue reported in the original bug (crbug.com/247770).

BUG=247770,445368

Review URL: https://codereview.chromium.org/834483002
2014-12-29 11:36:39 -08:00
bsalomon
b0ae649b7e Add device space skshader GM to test kDevice_GrCoordSet
Review URL: https://codereview.chromium.org/816003002
2014-12-29 07:05:27 -08:00
reed
d990e2f14f add testing flag to ignore saveLayer bounds
BUG=skia:

Review URL: https://codereview.chromium.org/819123003
2014-12-22 11:58:30 -08:00
jvanverth
39edf7664f Rename GrGpuGL -> GrGLGpu
Review URL: https://codereview.chromium.org/824753002
2014-12-22 11:44:19 -08:00
robertphillips
f3f5bad7de Add toString methods to SkImageFilter-derived classes
This isn't definitive but at least makes something show up in the debugger.

Review URL: https://codereview.chromium.org/789163006
2014-12-19 13:49:15 -08:00
reed
53b9e2e0f2 add const to encodePixels pixel parameter
BUG=skia:

Review URL: https://codereview.chromium.org/788143007
2014-12-19 12:26:07 -08:00
reed
438b0d754d Enable new gradients + suppress gms for now
This reverts commit 2c770271e6.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/811753003
2014-12-19 07:40:26 -08:00
tfarina
1348dfd5df Cleanup: Remove a bunch of SkFontHost.h includes (unused).
Nobody that is including SkFontHost is using SkFontHost API, so lets
remove this includes, since the API per se is deprecated.

BUG=None
R=reed@google.com

Review URL: https://codereview.chromium.org/803733006
2014-12-18 05:48:53 -08:00
jvanverth
1334c21eee One more pass at getting half float texture configs correct.
Added in check for sized internal format.
Made choice between RED and ALPHA orthogonal to HALF_FLOAT and
HALF_FLOAT_OES.
Enabled rendertarget support on ES 2.0.

Review URL: https://codereview.chromium.org/805033002
2014-12-18 05:44:55 -08:00
bsalomon
3e79124a69 Stop creating GrODS for stencilPath commands.
Review URL: https://codereview.chromium.org/816513003
2014-12-17 13:43:13 -08:00
reed
220f926d9d use conics
BUG=skia:

Review URL: https://codereview.chromium.org/455043002
2014-12-17 08:21:05 -08:00
fs
88640cf363 SkMatrix44(const SkMatrix&) needs to initialize the type mask
Review URL: https://codereview.chromium.org/791723006
2014-12-16 08:36:11 -08:00
robertphillips
478dd72336 Fix layer hoisting image filter corner cases
This CL fixes 5 bugs related to hoisting image filters:

For image filters the src layer (the one prior to filtering) often needs to be
smaller then the final layer. This requires the saveLayer's optional bounds
to be stored (in SkLayerInfo.h and SkRecordDraw.cpp) and then used in
compute_source_rect and carried around in GrCachedLayer.

The image filters can add an extra offset to the final draw operation.
This is now computed in GrLayerHoister::FilterLayer and  carried around in
GrCachedLayer.

Filtered layers must use exact matches. This is now done in GrLayerCache::lock.

The filter cache requires a valid matrix so it can compute the correct offset.
This is now done in GrLayerHoister::FilterLayer.

Filtered layers need to be drawn with drawSprite while unfiltered (and therefore
hopefully atlased) layers can be drawn with drawBitmap. This is now done in
draw_replacement_bitmap.

Committed: https://skia.googlesource.com/skia/+/702eb9622102599d94ab6798e6227cf29f48c2d3

Review URL: https://codereview.chromium.org/803183003
2014-12-16 08:25:55 -08:00
robertphillips
86f032832f Revert of Fix layer hoisting image filter corner cases (patchset #3 id:40001 of https://codereview.chromium.org/803183003/)
Reason for revert:
Breaking DM

Original issue's description:
> Fix layer hoisting image filter corner cases
>
> This CL fixes 5 bugs related to hoisting image filters:
>
> For image filters the src layer (the one prior to filtering) often needs to be
> smaller then the final layer. This requires the saveLayer's optional bounds
> to be stored (in SkLayerInfo.h and SkRecordDraw.cpp) and then used in
> compute_source_rect and carried around in GrCachedLayer.
>
> The image filters can add an extra offset to the final draw operation.
> This is now computed in GrLayerHoister::FilterLayer and  carried around in
> GrCachedLayer.
>
> Filtered layers must use exact matches. This is now done in GrLayerCache::lock.
>
> The filter cache requires a valid matrix so it can compute the correct offset.
> This is now done in GrLayerHoister::FilterLayer.
>
> Filtered layers need to be drawn with drawSprite while unfiltered (and therefore
> hopefully atlased) layers can be drawn with drawBitmap. This is now done in
> draw_replacement_bitmap.
>
> Committed: https://skia.googlesource.com/skia/+/702eb9622102599d94ab6798e6227cf29f48c2d3

TBR=bsalomon@google.com
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/790643009
2014-12-16 07:41:37 -08:00
bsalomon
861e103701 Rename GrGpuGL to GrGLGpu for consistency
Review URL: https://codereview.chromium.org/808593003
2014-12-16 07:33:50 -08:00
robertphillips
702eb96221 Fix layer hoisting image filter corner cases
This CL fixes 5 bugs related to hoisting image filters:

For image filters the src layer (the one prior to filtering) often needs to be
smaller then the final layer. This requires the saveLayer's optional bounds
to be stored (in SkLayerInfo.h and SkRecordDraw.cpp) and then used in
compute_source_rect and carried around in GrCachedLayer.

The image filters can add an extra offset to the final draw operation.
This is now computed in GrLayerHoister::FilterLayer and  carried around in
GrCachedLayer.

Filtered layers must use exact matches. This is now done in GrLayerCache::lock.

The filter cache requires a valid matrix so it can compute the correct offset.
This is now done in GrLayerHoister::FilterLayer.

Filtered layers need to be drawn with drawSprite while unfiltered (and therefore
hopefully atlased) layers can be drawn with drawBitmap. This is now done in
draw_replacement_bitmap.

Review URL: https://codereview.chromium.org/803183003
2014-12-16 07:27:30 -08:00
mtklein
9a5380dd35 Revert of Use SkPaint::getFontBounds() for text bounding boxes in pictures. (patchset #1 id:1 of https://codereview.chromium.org/805983003/)
Reason for revert:
Test-Win7-ShuttleA-HD2000-x86-Debug-GDI

Original issue's description:
> Use SkPaint::getFontBounds() for text bounding boxes in pictures.
>
> Now that SkTextBlobs have landed, this is a perf no-op, but it at least lets us eliminate a bunch of questionable hacks.
>
> CQ_EXTRA_TRYBOTS=client.skia:Test-Win7-ShuttleA-HD2000-x86-Debug-Trybot,Test-Mac10.8-MacMini4.1-GeForce320M-x86_64-Debug-Trybot
>
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/02d2b9831579173e783569530ab7bae08de907e9

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

Review URL: https://codereview.chromium.org/789793004
2014-12-16 06:31:01 -08:00
mtklein
02d2b98315 Use SkPaint::getFontBounds() for text bounding boxes in pictures.
Now that SkTextBlobs have landed, this is a perf no-op, but it at least lets us eliminate a bunch of questionable hacks.

CQ_EXTRA_TRYBOTS=client.skia:Test-Win7-ShuttleA-HD2000-x86-Debug-Trybot,Test-Mac10.8-MacMini4.1-GeForce320M-x86_64-Debug-Trybot

BUG=skia:

Review URL: https://codereview.chromium.org/805983003
2014-12-16 06:17:54 -08:00
scroggo
f9d610179d There can be only one (SkRandom)!
Remove SkLCGRandom. We already decided the new one was better, which is
why we wrote the new SkRandom.

Convert GMs that were using SkLCGRandom to use the improved SkRandom.
Motivated by the fact that these GMs draw differently on some runs. We
believe this to be a result of using the old SkLCGRandom.

Add each of the tests that were using SkLCGRandom to ignore-tests.txt,
since we expect they'll draw differently using SkRandom.

Move a trimmed down version of SkLCGRandom into SkDiscretePathEffect.
In order to preserve the old behavior, trim down SkLCGRandom to only
the methods used by SkDiscretePathEffect, and hide it in
SkDiscretePathEffect's cpp file.

BUG=skia:3241

Review URL: https://codereview.chromium.org/805963002
2014-12-15 12:54:51 -08:00
reed
5bcbe91304 Fix rrects that are large enough that we lose/gain a bit when we add the radius to a bounds coordinate.
add test that triggers assert in addRRect

BUG=skia:3239

Review URL: https://codereview.chromium.org/803153003
2014-12-15 12:28:33 -08:00
junov
3fcc125c77 Remove SkCanvas::isDrawingToLayer
BUG=3245

Review URL: https://codereview.chromium.org/803913005
2014-12-15 11:34:06 -08:00
reed
7534cf1703 ensure 4-byte alignment for storage, as SkWriterBuffer requires it
BUG=skia:3244

Review URL: https://codereview.chromium.org/805803002
2014-12-15 06:41:02 -08:00
reed
451e822705 add get9 and set9 to matrix, to aid in making keys
BUG=skia:
TBR=
NOTREECHECKS=True

Review URL: https://codereview.chromium.org/806543002
2014-12-13 08:46:49 -08:00
joshualitt
43893e4ca9 GLPrograms leak fix
NOTREECHECKS=True
TBR=
BUG=skia:

Review URL: https://codereview.chromium.org/799063005
2014-12-13 06:46:13 -08:00
bsalomon
fbaace0827 DM warning-free on win64
Review URL: https://codereview.chromium.org/805543002
2014-12-12 16:41:46 -08:00
bsalomon
9880607151 Even more win64 warning fixes
Review URL: https://codereview.chromium.org/800993002
2014-12-12 15:11:18 -08:00
jbroman
1607156689 Handle SkBitmaps which have no pixels in SkPDFImage.
A test that ensures this no longer crashes has been added.

BUG=skia:3232

Review URL: https://codereview.chromium.org/802713002
2014-12-12 11:28:16 -08:00
mtklein
f0f1411343 Cull pushCull and popCull from Skia.
These calls are unused and going away.  Waiting on crrev.com/796083002.

BUG=skia:

Review URL: https://codereview.chromium.org/794263002
2014-12-12 08:46:25 -08:00
mtklein
59dba146fe SkRecord: increase min block to 512B, remove max.
When we added the 64K allocation cap, the bots showed we took a perf hit
on some large .skps like desk_pokemonwiki.skp, despite not seeing a local
effect.  I'm still not seeing that locally, but I'd like to try removing the cap on
the bots to see what happens.  For big monolithic pictures, really packing into
memory tightly is probably not as important as it is for tiny ones.

Similarly, we're probably being too cautious about making tiny allocations.
Today we start at 16 bytes, which isn't really enough to record anything.
Even the smallest picture, say,
    save
        clipRect
        drawRect
    restore
requires ~200 bytes, so we might as well move our minimum block size up
near there.

I don't know if 16 bytes is too small to start for GrTextStrikes, so I've left the
behavior the same (though the max is still gone).

Local recording performance is neutral-to-positive:
             tabl_deviantart.skp	 126us ->  129us	1.02x
                tabl_nytimes.skp	 110us ->  112us	1.02x
           tabl_cuteoverload.skp	 521us ->  530us	1.02x
             desk_mobilenews.skp	 673us ->  682us	1.01x
             desk_chalkboard.skp	 843us ->  854us	1.01x
                 desk_sfgate.skp	 528us ->  535us	1.01x
            desk_silkfinance.skp	68.2us ->   69us	1.01x
                desk_youtube.skp	 623us ->  629us	1.01x
                desk_blogger.skp	 472us ->  475us	1.01x
     desk_jsfiddlehumperclip.skp	42.2us -> 42.5us	1.01x
                   desk_espn.skp	 255us ->  256us	1.01x
                   desk_ebay.skp	 174us ->  174us	1x
                desk_twitter.skp	 454us ->  455us	1x
                 tabl_pravda.skp	 200us ->  201us	1x
              desk_wordpress.skp	 782us ->  784us	1x
               desk_samoasvg.skp	 762us ->  761us	1x
                tabl_mozilla.skp	1.58ms -> 1.58ms	1x
               tabl_slashdot.skp	 107us ->  107us	1x
               tabl_techmeme.skp	 102us ->  102us	0.99x
            tabl_gamedeksiam.skp	 729us ->  724us	0.99x
                 tabl_nofolo.skp	65.3us -> 64.7us	0.99x
            desk_gmailthread.skp	 339us ->  336us	0.99x
                tabl_sahadan.skp	  91us ->   90us	0.99x
           desk_yahooanswers.skp	 144us ->  142us	0.99x
                   tabl_cnet.skp	 143us ->  141us	0.99x
             tabl_googleblog.skp	 206us ->  203us	0.99x
                    tabl_cnn.skp	 160us ->  158us	0.99x
               tabl_frantzen.skp	50.5us -> 49.6us	0.98x
               desk_linkedin.skp	 328us ->  323us	0.98x
                   tabl_digg.skp	 790us ->  769us	0.97x
         desk_jsfiddlebigcar.skp	40.6us -> 39.5us	0.97x
                 desk_mapsvg.skp	1.57ms -> 1.52ms	0.97x
                  tabl_gmail.skp	19.4us -> 18.6us	0.96x
                   tabl_hsfi.skp	9.81us -> 9.11us	0.93x

BUG=skia:

Review URL: https://codereview.chromium.org/793033002
2014-12-12 08:41:24 -08:00
jvanverth
a60b2ead80 Fix float and half float support on mobile.
It's unclear what params should be used for half float alpha
rendertargets, so they are disabled for the moment.

Review URL: https://codereview.chromium.org/799593002
2014-12-12 05:58:06 -08:00
kkinnunen
b5f4961b30 Fix GpuLayerCacheTest compile error
Fix GpuLayerCacheTest compile error:
GpuLayerCacheTest.cpp:120:34: error: comparison between signed and
unsigned integer expressions [-Werror=sign-compare]

gcc --version
gcc (Ubuntu/Linaro 4.6.4-1ubuntu1~12.04) 4.6.4

Review URL: https://codereview.chromium.org/794003003
2014-12-12 05:29:12 -08:00
joshualitt
56995b5cc0 Remove GP from drawstate, revision of invariant output for GP
BUG=skia:

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

Review URL: https://codereview.chromium.org/791743003
2014-12-11 15:44:02 -08:00
egdaniel
c230414861 Create xfer processor backend.
This includes:
-Having an actual XP stage at the end of the gl pipeline.
-All Blending work is handled by XP until actually setting GL blend states
-GLPrograms test to test XP

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/4dffc940c430eec66d4707490eace19c9b3f7904

Review URL: https://codereview.chromium.org/764643004
2014-12-11 13:15:14 -08:00
scroggo
895c43b28b Replace EncodeBitmap with an interface.
Gives more flexibility to the caller to decide whether to use the
encoded data returned by refEncodedData().

Provides an implementation that supports the old version of
SkPicture::serialize().

TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely

BUG=skia:3190

Review URL: https://codereview.chromium.org/784643002
2014-12-11 10:53:58 -08:00
reed
7bc0b42567 update test after I added a clip call, making the count odd
BUG=skia:
TBR=
NOTREECHECKS=True
NOTRY=True

Review URL: https://codereview.chromium.org/797633002
2014-12-11 07:30:58 -08:00
reed
2ff1fcede1 Defer saves() until they're needed
patch from issue 759443006 at patchset 40001 (http://crrev.com/759443006#ps40001)

BUG=skia:

Review URL: https://codereview.chromium.org/767333002
2014-12-11 07:07:38 -08:00
joshualitt
294738268d Revert of Create xfer processor backend. (patchset #6 id:100001 of https://codereview.chromium.org/764643004/)
Reason for revert:
CL breaks windows DM

Original issue's description:
> Create xfer processor backend.
>
> This includes:
> -Having an actual XP stage at the end of the gl pipeline.
> -All Blending work is handled by XP until actually setting GL blend states
> -GLPrograms test to test XP
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4dffc940c430eec66d4707490eace19c9b3f7904

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

Review URL: https://codereview.chromium.org/789343002
2014-12-10 15:03:01 -08:00
joshualitt
8c0f615fdd Revert of Remove GP from drawstate, revision of invariant output for GP (patchset #9 id:160001 of https://codereview.chromium.org/791743003/)
Reason for revert:
breaks mac

Original issue's description:
> Remove GP from drawstate, revision of invariant output for GP
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c6bc58eded89b0c0a36b8e20e193c200f297a0da

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

Review URL: https://codereview.chromium.org/794843002
2014-12-10 14:12:22 -08:00
joshualitt
c6bc58eded Remove GP from drawstate, revision of invariant output for GP
BUG=skia:

Review URL: https://codereview.chromium.org/791743003
2014-12-10 13:48:57 -08:00
reed
96472deea7 dd readPixels to SkImage
patch from issue 789673007 at patchset 1 (http://crrev.com/789673007#ps1)

BUG=skia:

Review URL: https://codereview.chromium.org/793723002
2014-12-10 09:53:42 -08:00
Florin Malita
c54d8db4d1 Remove SkCanvas::drawBitmapMatrix()
R=mtklein@google.com, reed@google.com, robertphillips@google.com

Review URL: https://codereview.chromium.org/789033002
2014-12-10 12:02:16 -05:00
egdaniel
4dffc940c4 Create xfer processor backend.
This includes:
-Having an actual XP stage at the end of the gl pipeline.
-All Blending work is handled by XP until actually setting GL blend states
-GLPrograms test to test XP

BUG=skia:

Review URL: https://codereview.chromium.org/764643004
2014-12-10 07:43:50 -08:00
reed
3054be16df Remove canvas::NewRaster, and rename surface::NewRasterPMColor to N32Premul
patch from issue 781403002 at patchset 20001 (http://crrev.com/781403002#ps20001)

BUG=skia:
TBR=
re-landing after chrome fixes have landed

Review URL: https://codereview.chromium.org/784223007
2014-12-10 07:24:28 -08:00
reed
67f2eb45b9 fix surface test for gpu and codecs
BUG=skia:

Review URL: https://codereview.chromium.org/789173004
2014-12-10 06:54:06 -08:00
reed
a8918a0650 Revert of remove (dumb) canvas::NewRaster, and rename surface::NewRasterPMColor to N32Premul (patchset #3 id:40001 of https://codereview.chromium.org/790733003/)
Reason for revert:
need to update chrome first

Original issue's description:
> remove (dumb) canvas::NewRaster, and rename surface::NewRasterPMColor to N32Premul
>
> patch from issue 781403002 at patchset 20001 (http://crrev.com/781403002#ps20001)
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/2c1605a1fbaa2e35a27399a34254fb1200ec2ae6

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

Review URL: https://codereview.chromium.org/791763002
2014-12-09 13:55:20 -08:00
joshualitt
2e3b3e369d This cl moves color and coverage off of drawstate. In an effort to keep this CL manageable, I have left the compute invariant input / output in a bit of a strange state(fixing this will be complicated).
In addition, NVPR makes this very complicated, and I haven't quite figured out a good way to handle it, so for now color and coverage DO live on optstate, but I will figure out some way to refactor that in future CLs.

BUG=skia:

Review URL: https://codereview.chromium.org/783763002
2014-12-09 13:31:15 -08:00
reed
2c1605a1fb remove (dumb) canvas::NewRaster, and rename surface::NewRasterPMColor to N32Premul
patch from issue 781403002 at patchset 20001 (http://crrev.com/781403002#ps20001)

BUG=skia:

Review URL: https://codereview.chromium.org/790733003
2014-12-09 12:33:38 -08:00
reed
a8b326c01a change SkPoint::setLength to set itself to (0,0) if it starting length is degenerate.
BUG=skia:3203
TBR=caryclark

Review URL: https://codereview.chromium.org/785933003
2014-12-09 11:50:33 -08:00
egdaniel
9513143efa Make all blending up to GrOptDrawState be handled by the xp/xp factory.
In this cl the blending information is extracted for the xp and stored in the ODS
which is then used as it currently is. In the follow up cl, an XP backend will be added
and at that point all blending work will take place inside XP's.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/7c66342a399b529634bed0fabfaa562db2c0dbd4

Review URL: https://codereview.chromium.org/759713002
2014-12-09 11:15:44 -08:00
scroggo
3030445799 Revert of Replace EncodeBitmap with an interface. (patchset #12 id:210001 of https://codereview.chromium.org/784643002/)
Reason for revert:
Failing serialization tasks in DM:

http://build.chromium.org/p/client.skia/builders/Test-Win8-ShuttleA-GTX660-x86-Debug/builds/352/steps/dm/logs/stdio

Original issue's description:
> Replace EncodeBitmap with an interface.
>
> Gives more flexibility to the caller to decide whether to use the
> encoded data returned by refEncodedData().
>
> Provides an implementation that supports the old version of
> SkPicture::serialize().
>
> TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely
>
> BUG=skia:3190
>
> Committed: https://skia.googlesource.com/skia/+/0c4aba6edb9900c597359dfa49d3ce4a41bc5dd1
>
> Committed: https://skia.googlesource.com/skia/+/02b217f80b01a7dda8493422e5257c36a9ce8464

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

Review URL: https://codereview.chromium.org/783393004
2014-12-09 08:27:37 -08:00
scroggo
02b217f80b Replace EncodeBitmap with an interface.
Gives more flexibility to the caller to decide whether to use the
encoded data returned by refEncodedData().

Provides an implementation that supports the old version of
SkPicture::serialize().

TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely

BUG=skia:3190

Committed: https://skia.googlesource.com/skia/+/0c4aba6edb9900c597359dfa49d3ce4a41bc5dd1

Review URL: https://codereview.chromium.org/784643002
2014-12-09 07:44:36 -08:00
robertphillips
c0708cb7bc Revert of Replace EncodeBitmap with an interface. (patchset #11 id:190001 of https://codereview.chromium.org/784643002/)
Reason for revert:
Compilation is failing on some bots

Original issue's description:
> Replace EncodeBitmap with an interface.
>
> Gives more flexibility to the caller to decide whether to use the
> encoded data returned by refEncodedData().
>
> Provides an implementation that supports the old version of
> SkPicture::serialize().
>
> TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely
>
> BUG=skia:3190
>
> Committed: https://skia.googlesource.com/skia/+/0c4aba6edb9900c597359dfa49d3ce4a41bc5dd1

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

Review URL: https://codereview.chromium.org/787833002
2014-12-09 05:35:07 -08:00
scroggo
0c4aba6edb Replace EncodeBitmap with an interface.
Gives more flexibility to the caller to decide whether to use the
encoded data returned by refEncodedData().

Provides an implementation that supports the old version of
SkPicture::serialize().

TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely

BUG=skia:3190

Review URL: https://codereview.chromium.org/784643002
2014-12-09 05:23:12 -08:00
egdaniel
8d95ffa497 Revert of Make all blending up to GrOptDrawState be handled by the xp/xp factory. (patchset #7 id:140001 of https://codereview.chromium.org/759713002/)
Reason for revert:
break many gm's

Original issue's description:
> Make all blending up to GrOptDrawState be handled by the xp/xp factory.
>
> In this cl the blending information is extracted for the xp and stored in the ODS
> which is then used as it currently is. In the follow up cl, an XP backend will be added
> and at that point all blending work will take place inside XP's.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/7c66342a399b529634bed0fabfaa562db2c0dbd4

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

Review URL: https://codereview.chromium.org/766653008
2014-12-08 13:26:43 -08:00
egdaniel
7c66342a39 Make all blending up to GrOptDrawState be handled by the xp/xp factory.
In this cl the blending information is extracted for the xp and stored in the ODS
which is then used as it currently is. In the follow up cl, an XP backend will be added
and at that point all blending work will take place inside XP's.

BUG=skia:

Review URL: https://codereview.chromium.org/759713002
2014-12-08 11:20:40 -08:00
caryclark
d3d1a988b1 add convexity logic and tests for scalar max, Inf, and NaN
PathOps relies on isConvex() only returning true for trivially
convex paths. The old logic also returns true if the paths that
contain NaNs and Infinities. Return kUnknown_Convexity instead
in those cases and in cases where the convexity logic computes
intermediaries that overflow.

Review URL: https://codereview.chromium.org/784593002
2014-12-08 04:57:38 -08:00
jvanverth
28f9c606e4 Add support for half float alpha textures.
This allows us to create distance field textures with better precision,
which may help text quality.

BUG=skia:3103

Review URL: https://codereview.chromium.org/762923003
2014-12-05 13:06:35 -08:00
joshualitt
eb2a676165 Remove backend factories
BUG=skia:

Review URL: https://codereview.chromium.org/778453002
2014-12-04 11:35:34 -08:00
joshualitt
dafa4d09cb move program descriptor generation to flush
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/829e1b80b1020b17f2078020c990e079b70c077c

Review URL: https://codereview.chromium.org/777673003
2014-12-04 08:59:10 -08:00
mtklein
c88cedaf88 Fix up RecordReplaceDrawTest memory leak.
http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind/builds/151/steps/dm/logs/stdio

BUG=skia:

Review URL: https://codereview.chromium.org/779973002
2014-12-04 07:53:21 -08:00
reed
8eddfb50c0 Change clear() to respect the clip
This reverts commit af641a1c10.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/783493002
2014-12-04 07:50:14 -08:00
joshualitt
f78c60c92a Revert of move program descriptor generation to flush (patchset #7 id:120001 of https://codereview.chromium.org/777673003/)
Reason for revert:
breaking linux build

Original issue's description:
> move program descriptor generation to flush
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/829e1b80b1020b17f2078020c990e079b70c077c

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

Review URL: https://codereview.chromium.org/776243005
2014-12-04 06:01:45 -08:00
joshualitt
829e1b80b1 move program descriptor generation to flush
BUG=skia:

Review URL: https://codereview.chromium.org/777673003
2014-12-03 13:57:37 -08:00
robertphillips
e99d499caa Fuse GrReplacements and GrLayerCache
The conversion step from GrCachedLayer to ReplacementInfo isn't necessary.

Review URL: https://codereview.chromium.org/769533004
2014-12-03 07:33:57 -08:00
joshualitt
2dd1ae016d First step to moving vertex attributes to the geometryProcessor
BUG=skia:

Review URL: https://codereview.chromium.org/761563002
2014-12-03 06:24:10 -08:00
reed
af641a1c10 Revert "Change clear() to respect the clip"
This reverts commit 3729469d6a.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/778563002
2014-12-02 19:40:18 -08:00
reed
3729469d6a Change clear() to respect the clip
patch from issue 769703002 at patchset 1 (http://crrev.com/769703002#ps1)

BUG=skia:

Review URL: https://codereview.chromium.org/772533004
2014-12-02 10:08:11 -08:00
halcanary
d476a176b7 Remove PDF JPEG shortcut, since it fails on grayscale JPEGs.
BUG=436079

Review URL: https://codereview.chromium.org/767343002
2014-12-02 06:37:21 -08:00
mtklein
3f3b3d0035 Remove SK_SUPPORT_LEGACY_DEEPFLATTENING.
This was needed for pictures before v33, and we're now requiring v35+.

Will follow up with the same for skia/ext/pixel_ref_utils_unittest.cc

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/52c293547b973f7fb5de3c83f5062b07d759ab88

Review URL: https://codereview.chromium.org/769953002
2014-12-01 11:47:08 -08:00
mtklein
6e78293ee8 Revert of Remove SK_SUPPORT_LEGACY_DEEPFLATTENING. (patchset #1 id:1 of https://codereview.chromium.org/769953002/)
Reason for revert:
Breaks canary builds.  Will reland after the Chromium change lands.

Original issue's description:
> Remove SK_SUPPORT_LEGACY_DEEPFLATTENING.
>
> This was needed for pictures before v33, and we're now requiring v35+.
>
> Will follow up with the same for skia/ext/pixel_ref_utils_unittest.cc
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/52c293547b973f7fb5de3c83f5062b07d759ab88

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

Review URL: https://codereview.chromium.org/768183002
2014-12-01 10:56:05 -08:00
mtklein
52c293547b Remove SK_SUPPORT_LEGACY_DEEPFLATTENING.
This was needed for pictures before v33, and we're now requiring v35+.

Will follow up with the same for skia/ext/pixel_ref_utils_unittest.cc

BUG=skia:

Review URL: https://codereview.chromium.org/769953002
2014-12-01 10:23:11 -08:00
robertphillips
01d6e5f462 Use variable length key (rather than accumulated matrix) as save layer hoisting key
Adding the rendering canvas' CTM to the layer hoisting key (i.e., Add support for hoisting layers in pictures drawn with a matrix - https://codereview.chromium.org/748853002/) has increased the cache miss rate due to accumulated floating point error. This CL fixes part of the issue by using the chain of operation indices leading to each saveLayer as the key. The canvas' CTM must still form part of the key but should be less subject to accumulated error.

BUG=skia:2315

Review URL: https://codereview.chromium.org/753253002
2014-12-01 09:09:27 -08:00
jvanverth
936799204b Add float-to-half (binary16) conversion functions.
Based on code by Fabian Giesen at
https://fgiesen.wordpress.com/2012/03/28/half-to-float-done-quic/.

These will be needed for creating binary16 textures from floating point data.

BUG=skia:3103

Review URL: https://codereview.chromium.org/760753003
2014-11-26 13:15:59 -08:00
reed
f0090cb80a add basic tests for save/restore counting
BUG=skia:

Review URL: https://codereview.chromium.org/763503003
2014-11-26 08:55:51 -08:00
joshualitt
267ce482b5 remove proc key
BUG=skia:

Review URL: https://codereview.chromium.org/755363002
2014-11-25 14:52:21 -08:00
mtklein
b116619028 Sk4x_sse.h
CQ_EXTRA_TRYBOTS=client.skia:Test-Mac10.6-MacMini4.1-GeForce320M-x86_64-Release-Trybot,Test-Mac10.7-MacMini4.1-GeForce320M-x86_64-Release-Trybot,Test-Win7-ShuttleA-HD2000-x86-Debug-GDI-Trybot

BUG=skia:

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

Review URL: https://codereview.chromium.org/698873003
2014-11-25 11:00:38 -08:00
bsalomon
a2c2323005 Remove GrSurface::isSameAs
Review URL: https://codereview.chromium.org/753783003
2014-11-25 07:41:12 -08:00
bsalomon
10e23caea3 Use scratch keys for stencil buffers.
BUG=skia:2889

Committed: https://skia.googlesource.com/skia/+/91175f19664a62851da4ca4e0984a7c7c45b258f

Review URL: https://codereview.chromium.org/747043004
2014-11-25 05:52:06 -08:00
reed
afa278e250 more c
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/736133006
2014-11-24 19:11:48 -08:00
reed
1bdfd3f4f0 option to return drawable from recording
patch from issue 747033005 at patchset 80001 (http://crrev.com/747033005#ps80001)

BUG=skia:

Review URL: https://codereview.chromium.org/732653004
2014-11-24 14:41:51 -08:00
mtklein
bbb61d7268 make SkRefCnt::getRefCnt() debug-only, remove it from SkNVRefCnt.
Only (unused) API removed.
TBR=reed@google.com

BUG=skia:3160

Review URL: https://codereview.chromium.org/752263002
2014-11-24 13:09:39 -08:00
bsalomon
19cd0f1813 Revert "Use scratch keys for stencil buffers."
This reverts commit 91175f1966.

Revert "Cleanup res cache bench and split out into a unit test."

This reverts commit 4e4303f002.

Revert "rebaselines"

This reverts commit 65ba7b5775.

TBR=tomhudson@google.com

Review URL: https://codereview.chromium.org/752233002
2014-11-24 12:19:06 -08:00
reed
90d0ff013b add some debugging to SkNVRefCnt
BUG=skia:

Review URL: https://codereview.chromium.org/745383003
2014-11-24 12:02:31 -08:00
bsalomon
4e4303f002 Cleanup res cache bench and split out into a unit test.
BUG=skia:2889

Review URL: https://codereview.chromium.org/754833002
2014-11-24 08:25:05 -08:00
mtklein
04c9695055 Remove Picture deletion listeners.
Looks like we can just have ~SkPicture put the message on the bus directly.

BUG=skia:3144

Review URL: https://codereview.chromium.org/751663002
2014-11-24 08:20:58 -08:00
bsalomon
932f866987 Create GrOptDrawState directly in the cmd buffer in GrIODB.
Review URL: https://codereview.chromium.org/746243002
2014-11-24 06:47:48 -08:00
bsalomon
77d77f446d Add pop_back to GrTRecorder.h
Review URL: https://codereview.chromium.org/750613002
2014-11-21 14:38:06 -08:00
reed
4af267b119 add SkImage::newSurface
BUG=skia:

Review URL: https://codereview.chromium.org/741763002
2014-11-21 08:46:38 -08:00
mtklein
19996eda62 Small changes to get things building and running on Linux/ARM.
ninja -C out/Debug works, and I tested out/Debug/dm --nogpu (no X yet).

The only problems encountered were:
  - Like CrOS, I also needed to use the default float ABI (presumably hard).
  - The strings in GrBinHashKeyTest weren't necessarily 4-byte aligned.

BUG=skia:

Review URL: https://codereview.chromium.org/746043002
2014-11-21 06:48:43 -08:00
fmalita
8ebaa71712 Revert of SkCanvas::clear() should call down to devices even when the clip is empty. (patchset #1 id:1 of https://codereview.chromium.org/735233003/)
Reason for revert:
Chrome unit_tests failures on Mac & Win, blocking the roll: http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/5613

Original issue's description:
> SkCanvas::clear() should call down to devices even when the clip is empty.
>
> SkDrawIter had a lovely, completely unused, option for this.  Oversight?
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/378e70d8e561b72a904286ea231946f5c8345b9a

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

Review URL: https://codereview.chromium.org/748733002
2014-11-20 20:44:04 -08:00
fmalita
2d97bc139a Disable LCD text explicitly in SkPictureImageFilter::onFilterImage()
As an intermediate fix for
https://code.google.com/p/skia/issues/detail?id=3142, we can use a
non-public SkCanvas constructor and force-disable LCD text.

BUG=skia:3142
R=reed@google.com,senorblanco@google.com

Review URL: https://codereview.chromium.org/725243004
2014-11-20 10:44:58 -08:00
bsalomon
b03c4a35bd Don't use NULL GrOptDrawState to indicate that draw should be skipped.
Review URL: https://codereview.chromium.org/742853002
2014-11-20 09:56:11 -08:00
mtklein
08d1fccf6e Add SkNVRefCnt, prune down SkPicture's size
SkNVRefCnt is a variant of SkRefCnt that's Not Virtual, so weighs 4 bytes
instead of 8 or 16.  There's only benefit to doing this if the deriving class
does not otherwise need a vtable, e.g. SkPicture.

I've stripped out some cruft from SkPicture, rearranged fields to pack tightly,
and added compile asserts for the sizes of SkPicture, SkRecord, and
SkVarAlloc.

BUG=skia:3144

Review URL: https://codereview.chromium.org/741793002
2014-11-20 09:18:32 -08:00
mtklein
378e70d8e5 SkCanvas::clear() should call down to devices even when the clip is empty.
SkDrawIter had a lovely, completely unused, option for this.  Oversight?

BUG=skia:

Review URL: https://codereview.chromium.org/735233003
2014-11-20 08:58:02 -08:00
mtklein
7cc1a34fbf Make sure pictures draw Clears even when the clip is empty.
We fix this by rewriting empty queries to very tiny queries, which will certainly
hit ops that span the entire picture (like Clear) and hopefully not much more.

(This doesn't quite work in the full cull rect world if [0,0,ε,ε] doesn't
overlap the picture.  Let's cross that bridge when we get there.)

BUG=432991

Review URL: https://codereview.chromium.org/732723004
2014-11-20 08:01:09 -08:00
tomhudson
158fcaa031 Implement SkPicture::bytesUsed() for SkRecord backend
BUG=chromium:230419
R=mtklein@google.com,reed@google.com

Review URL: https://codereview.chromium.org/490253003
2014-11-19 10:41:14 -08:00
joshualitt
54e0c12a5a scissor state on optstate
waiting

BUG=skia:

Review URL: https://codereview.chromium.org/742763002
2014-11-19 09:38:51 -08:00
bsalomon
ae59b77612 Create GrOptDrawState before recording draw in GrInOrderDrawBuffer
Review URL: https://codereview.chromium.org/739673002
2014-11-19 08:23:49 -08:00
reed
78e2768897 Allow pictures to have a full bounds
This reverts commit 7c4cdd2c5b.

BUG=skia:

Review URL: https://codereview.chromium.org/738083002
2014-11-19 08:04:34 -08:00
reed
7c4cdd2c5b Revert of allow pictures to have a full bounds (patchset #3 id:40001 of https://codereview.chromium.org/736583004/)
Reason for revert:
needed to update legacy width() helpers

Original issue's description:
> allow pictures to have a full bounds
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/7e76bff26e7c74902841ca4f607eb0b24a833a4a

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

Review URL: https://codereview.chromium.org/722043005
2014-11-19 07:17:17 -08:00
reed
7e76bff26e allow pictures to have a full bounds
BUG=skia:

Review URL: https://codereview.chromium.org/736583004
2014-11-19 06:59:41 -08:00
reed
6be2aa9a25 wip for drawables
Idea:

1. in its mutable recording state, keep a table of drawables on the side, and store an index in the record list.

2. In "immediate-mode" draw, just call the clients drawable directly (need access to our private list to turn the stored index into a proc)

3. when we "snap", we replace the list of drawables with a list of (sub) pictures, and then during playback of the snapped picture, we invoke a private drawable which just calls "drawPicture" on the index'd subpicture.

Review URL: https://codereview.chromium.org/727363003
2014-11-18 11:08:05 -08:00
mtklein
0bd57b2e1e SkVarAlloc::approxBytesAllocated()
This is what I was getting at on the other CL.

BUG=skia:

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

CQ_EXTRA_TRYBOTS=client.skia.android:Test-Android-Nexus5-Adreno330-Arm7-Release-Trybot

Review URL: https://codereview.chromium.org/730193003
2014-11-18 09:32:36 -08:00
mtklein
a06a953121 Prune SkRTree
- Propagate a bunch of constant parameters through.
  - Delete code that's not used when bulk loading.
  - Allocate all Nodes together.
  - Stay in SkRect.

Doing a single malloc for the nodes can't not have improved memory usage.

Looks like this might improve record performance ~5%, probably mostly from
staying in SkRects.  This finally dethrones building the BBH as the hot spot.
(Now it's mapping user bounds back to device bounds and adjusting for paints.)

Recording time changes from my MBP:
    desk_rectangletransition.skp	11.5us -> 11.7us	1x
             desk_forecastio.skp	 115us ->  114us	0.98x
                desk_booking.skp	 550us ->  541us	0.98x
            tabl_mercurynews.skp	 176us ->  173us	0.98x
                   tabl_hsfi.skp	 294us ->  287us	0.98x
              desk_wordpress.skp	 351us ->  343us	0.98x
           tabl_worldjournal.skp	 439us ->  426us	0.97x
                  tabl_gmail.skp	20.3us -> 19.7us	0.97x
         desk_youtubetvvideo.skp	10.8us -> 10.4us	0.97x
             desk_googleplus.skp	 1.1ms -> 1.07ms	0.97x
               tabl_slashdot.skp	 106us ->  103us	0.97x
         desk_jsfiddlebigcar.skp	26.7us -> 25.7us	0.96x
               tabl_techmeme.skp	95.4us -> 91.7us	0.96x
             tabl_deviantart.skp	 133us ->  127us	0.96x
              desk_pinterest.skp	40.6us -> 38.9us	0.96x
                 desk_carsvg.skp	 195us ->  187us	0.96x
               tabl_engadget.skp	 376us ->  359us	0.96x
                tabl_sahadan.skp	60.5us -> 57.5us	0.95x
      tabl_culturalsolutions.skp	 255us ->  242us	0.95x
                  tabl_gspro.skp	58.3us -> 55.5us	0.95x
               desk_linkedin.skp	 146us ->  138us	0.94x
                   desk_ebay.skp	 192us ->  181us	0.94x
                    tabl_cnn.skp	 467us ->  440us	0.94x
     desk_jsfiddlehumperclip.skp	29.9us -> 28.1us	0.94x
               desk_tigersvg.skp	43.2us -> 40.5us	0.94x
           desk_yahooanswers.skp	 131us ->  123us	0.94x
desk_googlespreadsheetdashed.skp	1.18ms -> 1.11ms	0.94x
                desk_blogger.skp	 193us ->  181us	0.94x
                tabl_mozilla.skp	1.82ms ->  1.7ms	0.94x
                    tabl_mlb.skp	 145us ->  136us	0.93x
              mobi_wikipedia.skp	 577us ->  539us	0.93x
               tabl_frantzen.skp	54.1us -> 50.4us	0.93x
                  desk_baidu.skp	87.9us -> 81.9us	0.93x
             desk_techcrunch.skp	 224us ->  209us	0.93x
                 desk_sfgate.skp	 206us ->  192us	0.93x
                  tabl_ukwsj.skp	 269us ->  250us	0.93x
               desk_facebook.skp	 316us ->  293us	0.93x
            desk_gmailthread.skp	 205us ->  190us	0.93x
         tabl_googlecalendar.skp	 158us ->  147us	0.93x
                   tabl_digg.skp	 382us ->  354us	0.93x
                 desk_amazon.skp	 106us -> 98.5us	0.93x
          tabl_androidpolice.skp	 693us ->  642us	0.93x
                tabl_nytimes.skp	 206us ->  191us	0.92x
                    desk_gws.skp	 124us ->  114us	0.92x
                desk_youtube.skp	 255us ->  235us	0.92x
           tabl_cuteoverload.skp	 583us ->  537us	0.92x
            desk_oldinboxapp.skp	  18us -> 16.6us	0.92x
             desk_mobilenews.skp	 297us ->  273us	0.92x
                 tabl_pravda.skp	 168us ->  154us	0.92x
              tabl_vnexpress.skp	 236us ->  217us	0.92x
          desk_css3gradients.skp	 202us ->  185us	0.92x
            tabl_gamedeksiam.skp	 508us ->  464us	0.91x
                desk_wowwiki.skp	1.02ms ->  929us	0.91x
                   desk_espn.skp	 209us ->  191us	0.91x
             desk_chalkboard.skp	 315us ->  284us	0.9x
                 desk_mapsvg.skp	 607us ->  543us	0.89x
            desk_pokemonwiki.skp	5.18ms -> 4.62ms	0.89x
               desk_samoasvg.skp	 335us ->  298us	0.89x
        desk_youtubetvbrowse.skp	10.1us -> 8.59us	0.85x
BUG=skia:3085, skia:2834

Review URL: https://codereview.chromium.org/734723002
2014-11-18 09:27:49 -08:00
mtklein
52b7822fa6 Revert of SkVarAlloc::approxBytesAllocated (patchset #5 id:80001 of https://codereview.chromium.org/730193003/)
Reason for revert:
Android needs dlmalloc_usable_size().

Original issue's description:
> SkVarAlloc::approxBytesAllocated()
>
> This is what I was getting at on the other CL.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/f27f1bcce50c8f95aea8469684a70b70c9baee09
>
> CQ_EXTRA_TRYBOTS=Test-Android-Nexus5-Adreno330-Arm7-Release-Trybot

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

Review URL: https://codereview.chromium.org/741443002
2014-11-18 08:15:23 -08:00
mtklein
f27f1bcce5 SkVarAlloc::approxBytesAllocated()
This is what I was getting at on the other CL.

BUG=skia:

Review URL: https://codereview.chromium.org/730193003
2014-11-18 07:24:14 -08:00
joshualitt
9853ccef19 Drawstate on stack
BUG=skia:

Review URL: https://codereview.chromium.org/732693002
2014-11-17 14:22:49 -08:00
robertphillips
f52a063dfd Fix yet another convexicator issue
This CL fixes the case where a bad initial vector (i.e., nearly zero) managed to short circuit all of the convexicator's logic. The initial bad vector would become the last vector and then never get displaced.

The history of this is:

https://codereview.chromium.org/298973004/
Switched the convexicator to not advance the last vector when the cross product wasn't significant

https://codereview.chromium.org/573763002/
Fixed a bug (crbug.com/412640) wherein a zero area path was being incorrectly categorized as convex b.c. opposite but equal vectors were not signaling concavity.

BUG=433683

Review URL: https://codereview.chromium.org/727283003
2014-11-17 12:11:42 -08:00
bsalomon
84c8e62fad Allow GPU resources to not be counted against the cache budget.
BUG=skia:2889

Review URL: https://codereview.chromium.org/721353002
2014-11-17 09:33:27 -08:00
bsalomon
dace19ec17 Correct accounting for wrapped resources
BUG=skia:2889

Review URL: https://codereview.chromium.org/720033004
2014-11-17 07:34:06 -08:00
reed
73c2501120 separate c headers
BUG=skia:

Review URL: https://codereview.chromium.org/728323002
2014-11-17 06:15:42 -08:00
joshualitt
5478d427c6 Push creation of default GP to the caller
TBR=
BUG=skia:

Review URL: https://codereview.chromium.org/715903002
2014-11-14 16:00:38 -08:00
scroggo
28562a0199 Fix Android framework build.
When we define SK_BUILD_FOR_ANDROID, we don't define it to anything,
so

    #if SK_BUILD_FOR_ANDROID

is not a meaningful check. Instead, use #ifdef.

TBR=caryclark@google.com, djsollen@google.com

Review URL: https://codereview.chromium.org/728013002
2014-11-14 14:49:34 -08:00
bsalomon
12299ab7a1 Make GrResourceCache2 responsible for calling release, abandon, and ~.
BUG=skia:2889

TBR=robertphillips@google.com

NOTRY=true

Review URL: https://codereview.chromium.org/729683002
2014-11-14 13:33:09 -08:00
bsalomon
71cb0c241e Replace GrResourceCache with GrResourceCache2.
BUG=skia:2889

Committed: https://skia.googlesource.com/skia/+/66a450f21a3da174b7eed89a1d5fc8591e8b6ee6

Committed: https://skia.googlesource.com/skia/+/407aa584d183c1bf314f5defd1cf0202e8a96c89

Review URL: https://codereview.chromium.org/716143004
2014-11-14 12:10:15 -08:00
mtklein
d4897591fd Don't pass null to memcmp.
This will allow us to add nonnull-attribute to the UBSAN bot.

We are in fact hitting a case where one of the arguments is null and the other
not, which seems dicey.  I think the scenario is comparing the empty pathref
with another path ref that's just been COWed, without any verbs or points yet.

BUG=skia:

Review URL: https://codereview.chromium.org/732643002
2014-11-14 09:22:40 -08:00
bsalomon
ac49acda52 Revert of Replace GrResourceCache with GrResourceCache2. (patchset #7 id:120001 of https://codereview.chromium.org/716143004/)
Reason for revert:
broken again

Original issue's description:
> Replace GrResourceCache with GrResourceCache2.
>
> BUG=skia:2889
>
> Committed: https://skia.googlesource.com/skia/+/66a450f21a3da174b7eed89a1d5fc8591e8b6ee6
>
> Committed: https://skia.googlesource.com/skia/+/407aa584d183c1bf314f5defd1cf0202e8a96c89

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

Review URL: https://codereview.chromium.org/726913002
2014-11-14 06:47:39 -08:00
bsalomon
407aa584d1 Replace GrResourceCache with GrResourceCache2.
BUG=skia:2889

Committed: https://skia.googlesource.com/skia/+/66a450f21a3da174b7eed89a1d5fc8591e8b6ee6

Review URL: https://codereview.chromium.org/716143004
2014-11-14 06:29:40 -08:00
reed
d54d3fc824 remove unused kLCD_MaskFormat
BUG=skia:

Review URL: https://codereview.chromium.org/728673002
2014-11-13 14:39:58 -08:00
bsalomon
f21dab9540 Revert of Replace GrResourceCache with GrResourceCache2. (patchset #6 id:100001 of https://codereview.chromium.org/716143004/)
Reason for revert:
Breaking stuff

Original issue's description:
> Replace GrResourceCache with GrResourceCache2.
>
> BUG=skia:2889
>
> Committed: https://skia.googlesource.com/skia/+/66a450f21a3da174b7eed89a1d5fc8591e8b6ee6

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

Review URL: https://codereview.chromium.org/715333003
2014-11-13 13:33:28 -08:00
bsalomon
66a450f21a Replace GrResourceCache with GrResourceCache2.
BUG=skia:2889

Review URL: https://codereview.chromium.org/716143004
2014-11-13 13:19:10 -08:00
mtklein
f2950b1c45 Deparameterize SkVarAlloc.
SkRecord performance is not sensitive to these values, so we can cut some
storage.  This rearranges the space-remaining logic to use a count of bytes
left rather than a pointer to the end, cutting memory usage a little more.

An SkVarAlloc used to weigh 20 or 32 bytes which now becomes 16 or 24.

I think if I think about it a bit more I can trim off that Block* too,
getting us to 12 or 16 bytes.

Because we now just always grow by doubling, this CL switches from storing
fSmallest to its log base 2.  This has the nice effect of never having to worry
about it overflowing, and means we can probably squeeze it down into a byte
if we want, even 6 bits.

BUG=skia:

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

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu12-ShuttleA-GTX660-x86-Debug-Trybot

Review URL: https://codereview.chromium.org/721313002
2014-11-13 12:41:14 -08:00
caryclark
912c9ec6ee disable a couple of new fuzz378 tests on android
these tests fail on a nexus 9 in release only. It's probably related
to the fused multiply-add instruction

TBR=

Review URL: https://codereview.chromium.org/722303002
2014-11-13 11:08:52 -08:00
caryclark
65f553182a These tests stress pathops by describing the union of circle-like paths that have tiny line segments embedded and double back to create near-coincident conditions.
The fixes include
- detect when finding the active top loops between two possible answers
- preflight chasing winding to ensure answer is consistent
- binary search more often when quadratic intersection fails
- add more failure paths when an intersect is missed

While this fixes the chrome bug, reenabling path ops in svg should be deferred until additional fixes are landed.

TBR=
BUG=421132

Committed: https://skia.googlesource.com/skia/+/6f726addf3178b01949bb389ef83cf14a1d7b6b2

Review URL: https://codereview.chromium.org/633393002
2014-11-13 06:58:52 -08:00
bsalomon
69ed47f42d Make GrGpuResource::gpuMemorySize non-virtual w/ onGpuMemorySize virtual impl
BUG=skia:2889

Review URL: https://codereview.chromium.org/702413003
2014-11-12 11:13:39 -08:00