Commit Graph

163 Commits

Author SHA1 Message Date
fmalita
c6765d69e3 Add some SkTextBlob builder tests.
R=reed@google.com, robertphillips@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/493443004
2014-08-21 15:03:04 -07:00
piotaixr
d2a3522503 Add the method isOpaque() to SkImage
BUG=skia:2766
R=junov@chromium.org, halcanary@google.com, scroggo@google.com, reed@google.com, bsalomon@google.com

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/406673003
2014-08-19 14:29:02 -07:00
djsollen
3b6255493e Remove SkPaintOptionsAndroid
Committed: https://skia.googlesource.com/skia/+/f32331ffdb5de0440bb337aa7cbdd6f33e9ff23b

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

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/447873003
2014-08-14 06:29:03 -07:00
bsalomon
c15e28a522 Revert of Remove SkPaintOptionsAndroid (patchset #5 of https://codereview.chromium.org/447873003/)
Reason for revert:
Breaks the Chromium build: http://108.170.220.120:10117/builders/Canary-Chrome-Ubuntu13.10-Ninja-x86_64-DRT/builds/2469/steps/BuildContentShell_1/logs/stdio

Original issue's description:
> Remove SkPaintOptionsAndroid
>
> Committed: https://skia.googlesource.com/skia/+/f32331ffdb5de0440bb337aa7cbdd6f33e9ff23b

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

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/473543004
2014-08-13 15:18:46 -07:00
djsollen
f32331ffdb Remove SkPaintOptionsAndroid
R=reed@google.com, mtklein@google.com, tomhudson@google.com

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/447873003
2014-08-13 13:09:49 -07:00
joshualitt
bab82ed05b Pretty print of shaders
BUG=skia:
R=bsalomon@chromium.org, senorblanco@chromium.org, bsalomon@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/437593004
2014-08-08 09:41:42 -07:00
Derek Sollenberger
da7a944e29 Revert "Remove SkPaintOptionsAndroid"
This reverts commit 27fb94999b.

Review URL: https://codereview.chromium.org/450513002
2014-08-06 16:34:40 -04:00
Derek Sollenberger
27fb94999b Remove SkPaintOptionsAndroid
Review URL: https://codereview.chromium.org/447873003
2014-08-06 16:30:51 -04:00
tomhudson
816b4fb97c Fix bad gypi
Must not depend directly on ports; depend on skialib!

R=bungeman@google.com

Author: tomhudson@chromium.org

Review URL: https://codereview.chromium.org/442883002
2014-08-05 12:01:09 -07:00
tomhudson
f79673bbae Test and generalize font configuration parser
Add a basic unit test for the Android font configuration parser.
Add a check for the new LMP file format; on detection, switch to a new
(as-yet unwritten) parser.

R=bungeman@google.com, djsollen@google.com, tomhudson@google.com

Author: tomhudson@chromium.org

Review URL: https://codereview.chromium.org/439813002
2014-08-05 06:36:14 -07:00
robertphillips
8ab8cc07cf Finish removing GrTHashTable
This class is no longer used in Ganesh (in favor of SkTDynamicHash)

R=jvanverth@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/421253003
2014-07-29 06:17:49 -07:00
djsollen
85d36525c6 fix android_framework build do to missing library at link time
R=scroggo@google.com

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/407073006
2014-07-22 13:56:34 -07:00
scroggo
24519371cb Run CanvasState test across a library boundary.
Refactor CanvasStateTest to pull out functions which can
either be called directly or from a shared library. Add a
command line flag to pass in the path to a library to open
to call those functions from.

Separate different CanvasTest tests into separate DEF_TEST
tests. This allows them to be run in parallel.

Move the ifdefs outside of function declarations to skip
running CanvasTest tests which do nothing.

Add the canvas_state_lib target. It is a shared library that
exports some functions to be called by another version of
Skia.

BUG=b/15693384
R=djsollen@google.com, reed@google.com

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/400043003
2014-07-22 12:38:55 -07:00
caryclark
17f0b6df72 share dm and command flags
Share command flags between dm and unit tests.
Also, allow dm's core to be included by itself and iOSShell.

Command line flags that are the same (or nearly the same) in DM
and in skia_tests have been moved to common_flags. Authors,
please check to see that the shared common flag is correct for
the tool.

For iOS, the 'tool_main' entry point has a wrapper to allow multiple
tools to be statically linked in the iOSShell.
Since SkCommandLineFlags::Parse can only be called once, these calls
are disabled in the IOS build.

Since the iOS app directory is dynamically assigned a name, use '@' to
select it. (This is the same convention chosen by the Mobile Harness
iOS file system utilities.)

Move the heart of dm.gyp into dm.gypi so that it can be included by
itself and iOSShell.gyp.

Add tools/flags/SkCommonFlags.* to define and declare common
command line flags.

Add support for dm to iOSShell.

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

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/389653004
2014-07-22 10:15:35 -07:00
sugoi
518d83dbc1 Skia side RGB to YUV gpu conversion
This code is the one that's currently working in my local chromium build. A few things still need to be addressed and I'll highlight these directly in the code.

BUG=skia:
R=reed@google.com, bsalomon@google.com, senorblanco@google.com, senorblanco@chromium.org, robertphillips@google.com, scroggo@google.com, halcanary@google.com

Author: sugoi@chromium.org

Review URL: https://codereview.chromium.org/374743003
2014-07-21 11:37:39 -07:00
halcanary
805ef159d1 Set maximum output size for scaled-image-cache images
Accessable via:
  SkScaledImageCache::{G,S}etMaximumOutputSizeForHighQualityFilter

Also, a unit test.

BUG=389439
R=humper@google.com, tomhudson@google.com, reveman@chromium.org, vangelis@chromium.org, reed@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/394003003
2014-07-17 06:58:01 -07:00
joshualitt
ee5da55477 32 bpp floating point textures
This is VERY preliminary, but it was sufficient for me to get 32 bit floating point textures in a sample app

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

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/359803003
2014-07-16 13:32:56 -07:00
bungeman
c7af812b42 Revert of Reopened: Caching the result of readPixelsSupported (https://codereview.chromium.org/364193004/)
Reason for revert:
This appears to be causing failures on Android when running tests.

Original issue's description:
> Caching the result of readPixelsSupported
>
> The call was calling GR_GL_GetIntegerv 2 times for each readPixels
> and thus was causing a loss of performance
>
> (resubmit of issue 344793008)
>
> Benchmark url: http://packages.gkny.fr/tst/index.html
>
> BUG=skia:2681
>
> Committed: https://skia.googlesource.com/skia/+/753a2964afe5661ce9b2a8ca77ca9d0aabd3173c
>
> Committed: https://skia.googlesource.com/skia/+/8339371f1ec3c57a0741932fd96bff32c53d4e54

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

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/395203002
2014-07-16 09:10:41 -07:00
piotaixr
8339371f1e Caching the result of readPixelsSupported
The call was calling GR_GL_GetIntegerv 2 times for each readPixels
and thus was causing a loss of performance

(resubmit of issue 344793008)

Benchmark url: http://packages.gkny.fr/tst/index.html

BUG=skia:2681

Committed: https://skia.googlesource.com/skia/+/753a2964afe5661ce9b2a8ca77ca9d0aabd3173c

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

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/364193004
2014-07-15 19:41:08 -07:00
piotaixr
cef04f8188 Deleted SkImage::newShaderClamp: not used, not implemented.
Implemented SkImage::newShader.

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

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/345463009
2014-07-14 07:48:04 -07:00
Mike Klein
874a62acef Revert "Remove ability for Release code to call getRefCnt() or getWeakRefCnt()."
This reverts commit 4ae94ffce5.

BUG=skia:

Review URL: https://codereview.chromium.org/382523002
2014-07-09 09:04:07 -04:00
tfarina
0a65e38560 Cleanup: Rename UnitTestTest.cpp to RTConfRegistryTest.cpp
BUG=None
TEST=make tests
R=mtklein@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/374443002
2014-07-08 10:33:28 -07:00
mtklein
4ae94ffce5 Remove ability for Release code to call getRefCnt() or getWeakRefCnt().
These getRefCnt() methods are not thread safe, so Skia code should not
be calling them.  unique() is fine.

SkDEBUG code (SkASSERTs) can still call getRefCnt() / getWeakRefCnt().

This adds tools/RefCntIs.{h,cpp}, which lets tests make their assertions in
both debug and release modes.

BUG=skia:2726
R=senorblanco@chromium.org, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/378643003
2014-07-08 06:48:17 -07:00
robertphillips
952841bf41 Begin atlasing
This CL makes it possible for pulled-forward-layers to be atlased. It currently has a couple glaring limitations (which is why it is disabled):

1) the atlased layers cannot be purged nor aged out
2) the texture backing the atlas is not pulled from (or returned to) the resource cache

#1 is on hold until we have a recycling rectanizer

A separate major limitation (the non-atlased layers aren't cached) is blocked until we can transmute entries in the resource cache from scratch to non-scratch while potentially preserving their contents.

Committed: https://skia.googlesource.com/skia/+/55e61f0ef4e5c8c34ac107deaadc9b4ffef3111b

R=bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/354533004
2014-06-30 08:26:50 -07:00
robertphillips
e462f2bed3 Revert of Begin atlasing (https://codereview.chromium.org/354533004/)
Reason for revert:
Sigh

Original issue's description:
> Begin atlasing
>
> This CL makes it possible for pulled-forward-layers to be atlased. It currently has a couple glaring limitations (which is why it is disabled):
>
> 1) the atlased layers cannot be purged nor aged out
> 2) the texture backing the atlas is not pulled from (or returned to) the resource cache
>
> #1 is on hold until we have a recycling rectanizer
>
> A separate major limitation (the non-atlased layers aren't cached) is blocked until we can transmute entries in the resource cache from scratch to non-scratch while potentially preserving their contents.
>
> Committed: https://skia.googlesource.com/skia/+/55e61f0ef4e5c8c34ac107deaadc9b4ffef3111b

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

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/359953002
2014-06-29 17:16:27 -07:00
robertphillips
55e61f0ef4 Begin atlasing
This CL makes it possible for pulled-forward-layers to be atlased. It currently has a couple glaring limitations (which is why it is disabled):

1) the atlased layers cannot be purged nor aged out
2) the texture backing the atlas is not pulled from (or returned to) the resource cache

#1 is on hold until we have a recycling rectanizer

A separate major limitation (the non-atlased layers aren't cached) is blocked until we can transmute entries in the resource cache from scratch to non-scratch while potentially preserving their contents.

R=bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/354533004
2014-06-29 15:08:31 -07:00
tfarina
11a005ee01 Promote SkInterpolator unit test to our tests driver.
BUG=None
TEST=make tests && out/Debug/tests -m Interpolator
R=mtklein@google.com, bsalomon@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/351713005
2014-06-26 13:07:05 -07:00
tfarina
12345aee12 Rename TestSize.cpp to SizeTest.cpp
It is the only file where Test is the prefix rather than the sufix.
 This patch fixes that so it matches with the rest of the files
 under tests/ directory.

And separate SkISize test into its own DEF_TEST().

BUG=None
TEST=make tests && out/Debug/tests
R=mtklein@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/337783007
2014-06-25 10:39:02 -07:00
tfarina
2010891425 Add GYP target for sk_tool_utils.* component.
This declares a static library target in gyp/sk_tool_utils.gyp, so other
targets can depend directly on it instead of including the source file
in their source lists.

BUG=None
TEST=make all
R=mtklein@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/348623006
2014-06-21 10:54:17 -07:00
mtklein
9ac68ee259 Move BenchTimer to tools as Timer
This breaks a bunch of circular dependencies between tools and gm and bench.

BUG=skia:

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

CQ_EXTRA_TRYBOTS=tryserver.skia:Build-Mac10.7-Clang-Arm7-Debug-iOS-Trybot,Test-Ubuntu12-ShuttleA-GTX660-x86-Debug-Trybot
R=tfarina@chromium.org, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/344213003
2014-06-20 11:29:21 -07:00
mtklein
9e64b78ff6 Revert of Move BenchTimer to tools as Timer (https://codereview.chromium.org/344213003/)
Reason for revert:
GpuTimer broken

Original issue's description:
> Move BenchTimer to tools as Timer
>
> This breaks a bunch of circular dependencies between tools and gm and bench.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4ed75287aed6371c6e4a41ffcc78c8a49c9810ed

R=tfarina@chromium.org, mtklein@chromium.org
TBR=mtklein@chromium.org, tfarina@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: mtklein@google.com

Review URL: https://codereview.chromium.org/346753003
2014-06-20 10:43:07 -07:00
mtklein
4ed75287ae Move BenchTimer to tools as Timer
This breaks a bunch of circular dependencies between tools and gm and bench.

BUG=skia:
R=tfarina@chromium.org, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/344213003
2014-06-20 10:31:49 -07:00
tfarina
bcbc1788b4 Refactor how we handle resources path in Tests.
This idea emerged while doing https://codereview.chromium.org/321723002/
(commit 880914c35c).

BUG=None
TEST=make tests && out/Debug/tests
R=mtklein@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/346453002
2014-06-18 14:32:49 -07:00
mtklein
887f3979f0 Add EXPERIMENTAL_beginRecording() for SkRecord-based recording.
The interesting stuff is in SkPictureRecorder.{h,cpp}.  The rest is mostly moving SkRecord from its own directories into core to avoid circular dependencies in GYP.

After plumbing SkRecord all the way through in Picture, I'll delete its old entry point include/record/SkRecording.h.  For now it and record.gypi need to stay where they are to keep Chrome building.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/331573004
2014-06-17 12:08:16 -07:00
tfarina
da4ed3289e Cleanup: Delete sk_tools::make_filepath() in favor of SkOSPath::SkPathJoin().
BUG=None
TEST=make tools tests && out/Debug/tests
R=epoger@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/327403002
2014-06-12 08:50:56 -07:00
krajcevski
2b310e46eb Texture compression unit tests along with a couple of bug fixes
R=robertphillips@google.com

Author: krajcevski@google.com

Review URL: https://codereview.chromium.org/330453005
2014-06-11 12:26:49 -07:00
cdalton
511923443f Generate path names on the client side
Pre-allocates a range of path names and manages allocations within
that range on the client side. This allows us to generate new path
objects in a feed-forward manner that doesn't require round trips to
the GL server.

BUG=skia:
R=bsalomon@google.com, markkilgard@gmail.com

Author: cdalton@nvidia.com

Review URL: https://codereview.chromium.org/304403003
2014-06-09 11:16:58 -07:00
krajcevski
c250d2e4ab Initial KTX encoder
The encoder comes with tests to check that the encoding/decoding
operations between ETC encoded bitmaps and ARGB bitmaps are sane.

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

Author: krajcevski@google.com

Review URL: https://codereview.chromium.org/312353003
2014-06-06 06:16:28 -07:00
commit-bot@chromium.org
7ae034d651 Test font created from paint
This is meant to allow clients to migrate over to a SkFont api on canvas (e.g. drawText(text, font, paint)) while still permitting the current setters in paint (e.g. setTextSize, setFlags).

R=bungeman@google.com, eae@chromium.org, fmalita@google.com, fmalita@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/245953003

git-svn-id: http://skia.googlecode.com/svn/trunk@14997 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-30 16:46:10 +00:00
commit-bot@chromium.org
ad854bf9c0 Add testing for Rectanizer-derived classes
This in preparation for expanding the Rectanizer API for removing rects and adding a new derived class

R=jvanverth@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/304313002

git-svn-id: http://skia.googlecode.com/svn/trunk@14972 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-29 18:46:38 +00:00
commit-bot@chromium.org
73fffeb83a Add pattern matchers for SkRecord
This is a mid-level library for finding patterns of commands in an SkRecord.  At the API level, it's a bit regex inspired.  Some examples:
 - Pattern1<Is<DrawRect>> matches a single DrawRect

 - Pattern1<Star<Is<DrawRect>>> matches 0 or more DrawRects

 - Pattern2<Is<ClipRect>, Is<DrawRect>> matches a single clip rect followed by a single draw rect

  - Pattern3<Is<Save>, Star<IsDraw>, Is<Restore>> matches a single Save, followed by any number of Draws, followed by Restore

 - Pattern1<Or<Is<DrawRect>, Is<ClipRect>>> matches a DrawRect or a ClipRect

 - Pattern1<Not<Is<ClipRect>>> matches a command that's notClipRect.

Once you have a pattern, you can call .search() on it to step through ranges of matching commands.  This means patterns can replace most of the custom iteration logic for optimization passes: the generic pattern searching steps through all the optimization candidates, which optimization-specific code further inspects and mutates.

SkRecordTraits is now unused.  Bye bye!

Generated code and performance of SkRecordOpts is very similar to what it was before.  (I had to use SK_ALWAYS_INLINE in a few places to make this so.)

BUG=skia:2378
R=fmalita@chromium.org, bungeman@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/263063002

git-svn-id: http://skia.googlecode.com/svn/trunk@14582 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-05 21:59:52 +00:00
commit-bot@chromium.org
8dac8b18ee Backfill unit tests for SkRecord
BUG=skia:2378
R=fmalita@chromium.org, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/251133008

git-svn-id: http://skia.googlecode.com/svn/trunk@14455 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-30 13:18:12 +00:00
commit-bot@chromium.org
a31eacb22e Refactor SkPictureStateTree::Iterator to avoid use of kClip_SaveFlag.
The current implementation relies on soon-to-be-deprecated
kClip_SaveFlag behavior. Updated to use default save flags
(kMatrixClip_SaveFlag) and stop assuming that the matrix survives
restore() calls.

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

Committed: http://code.google.com/p/skia/source/detail?r=14319

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/246893005

git-svn-id: http://skia.googlecode.com/svn/trunk@14421 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-28 20:17:48 +00:00
commit-bot@chromium.org
aec143824c Add asADash entry point into SkPathEffect to allow extracting Dash info from PathEffects
BUG=skia:
R=bsalomon@google.com, reed@google.com

Author: egdaniel@google.com

Review URL: https://codereview.chromium.org/212103010

git-svn-id: http://skia.googlecode.com/svn/trunk@14297 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-22 15:21:18 +00:00
commit-bot@chromium.org
855e88edfa Fixes for SkPictureShader.
Update comment in header to make it more clear that the picture
should be unaltered after creating the shader. We want our shaders
to be immutable, and this supports that.

Make the factory return NULL if the shader would have never drawn
anyway i.e. for a null picture or picture with no width/height.

Addresses comments I brought up in
https://codereview.chromium.org/221923007/#msg16.

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

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/238253005

git-svn-id: http://skia.googlecode.com/svn/trunk@14288 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-21 19:33:12 +00:00
commit-bot@chromium.org
b17a24fedb SkRecord: turn on cull annotation pass in public API.
Also, switch Skia internal tools over to use the public headers where
possible.  Where it's not, the tools -Isrc/record explicitly now, and
if it's not obvious, note why they don't use SkRecording.h.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/231853006

git-svn-id: http://skia.googlecode.com/svn/trunk@14191 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-14 20:33:05 +00:00
commit-bot@chromium.org
18fd2b923a Add a focused public API for src/record.
BUG=skia:2378
R=reed@google.com, robertphillips@google.com, mtklein@google.com, fmalita@chromium.org

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/233053005

git-svn-id: http://skia.googlecode.com/svn/trunk@14146 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-10 23:30:59 +00:00
commit-bot@chromium.org
6573ce70e6 Create SkLayerRasterizer w/o destroying Builder.
Add a new method to SkLayerRasterizer::Builder that creates a new
SkLayerRasterizer without destroying the Builder. Necessary to
continue to support Android's API.

Also fix a bug where creating a Builder and never calling
detachRasterizer results in not calling the destructor for any SkPaints
in the Builder.

Add tests.

BUG=b/13729784
R=reed@google.com, dominikg@chromium.org

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/233673002

git-svn-id: http://skia.googlecode.com/svn/trunk@14139 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-10 20:42:53 +00:00
commit-bot@chromium.org
d9ce2be6b2 SkRecordDraw: skip draw ops when the clip is empty
- Adds tests for SkRecordDraw's two main features: cull- and clip- based skipping.
   - Adds full SkCanvas semantic mode to SkRecorder, so it can be used as a target for SkRecordDraw.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/231653002

git-svn-id: http://skia.googlecode.com/svn/trunk@14124 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-09 23:30:28 +00:00
commit-bot@chromium.org
506db0b7d2 SkRecord: make culling work if SkRecordAnnotateCullingPairs is called.
- Allow stateful functors; allow visit()/mutate() at a given index; add count().
  - Annotate cull push/pop pairs on the PushCull records.  (tested)
  - Use those annotations to skip ahead in SkRecordDraw.   (not yet tested beyond dm --skr)
  - Make SkRecordDraw a function, move its implementation to a .cpp.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/229523002

git-svn-id: http://skia.googlecode.com/svn/trunk@14101 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-08 23:31:35 +00:00
commit-bot@chromium.org
b73696262c More SkRecord TODOs:
- add basic test for SkRecorder
  - rejigger GYPs so that the include dir comes along with the dependency

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/227673011

git-svn-id: http://skia.googlecode.com/svn/trunk@14099 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-08 20:17:26 +00:00
commit-bot@chromium.org
066a28d2c1 Start on some unwritten SkRecord TODOs:
- add SK_OVERRIDE for SkCanvas methods in SkRecorder
  - start on unit tests, here just for SkRecord itself

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/228723003

git-svn-id: http://skia.googlecode.com/svn/trunk@14097 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-08 17:31:08 +00:00
bungeman@google.com
95ebd17cf4 Add removeShuffle to SkTArray and add SkTArray tests.
R=reed@google.com

Review URL: https://codereview.chromium.org/208153008

git-svn-id: http://skia.googlecode.com/svn/trunk@13895 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-21 19:39:02 +00:00
commit-bot@chromium.org
af5346a39c Add reg test for http://crbug.com/348821
BUG=348821
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/189373008

git-svn-id: http://skia.googlecode.com/svn/trunk@13852 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-18 17:38:34 +00:00
commit-bot@chromium.org
949b9986de Fast implementation of QuadTree
Rewritten to avoid memory allocations.

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

Author: iancottrell@google.com

Review URL: https://codereview.chromium.org/187233002

git-svn-id: http://skia.googlecode.com/svn/trunk@13826 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-17 10:38:34 +00:00
commit-bot@chromium.org
4cd9e2169e Add SkCanvas::writePixels that takes info+pixels directly
add corresponding methods to device (w/ diff name to avoid colliding with exising virtuals)

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/180113010

git-svn-id: http://skia.googlecode.com/svn/trunk@13697 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-07 03:25:16 +00:00
commit-bot@chromium.org
a5572e5bb2 Add a class to allocate small objects w/o extra calls to new.
Add SkSmallAllocator, a template for allocating small (as defined by the
instantiation) objects without extra calls to new. Add a helper macro to
make using it simple.

Remove SkTemplatesPriv.h, whose behavior is replaced by SkSmallAllocator.
The old SK_PLACEMENT_NEW had the following drawbacks:
- Easily confused with SkNEW_PLACEMENT.
- Requires passing around lots of void*s along with the storageSize.
- Requires using a separate class for deleting it.
- We had multiple ways Auto objects for deleting in different places.
- It always did a straight heap allocation on Windows, meaning Windows
  did not get any advantages from the confusing code.
The new SkSmallAllocator simplifies things:
- It is clear about what it does.
- It takes care of the deletion in one place that is automatically
  handled.

Further, the new class can be used to create more than one object. This
is in preparation for BUG=skia:1976, for which we would like to create
a new object without extra heap allocations. The plan is to create both
the blitter and the new object on the stack using the SkSmallAllocator.

Add a new test for SkSmallAllocator.

SkShader.h:
Move the private version of CreateBitmapShader to SkBitmapProcShader
(which already has the implementation) and remove the friend class
(which was only used to call this private function). This allows
SkSmallAllocator to reside in the private src/ directory.

SkBitmapProcShader:
Move CreateBitmapShader and the macro for the storage size here. With
the macro in a (private) header, the (private) headers with function
declarations (which now depend on the storage size used) can see the
macro.
Use SkSmallAllocator in CreateBitmapShader.
Change the macro to kBlitterStorageByteCount, since SkSmallAllocator
takes a byte count as its template parameter.

SkBlitter:
Use the SkSmallAllocator.
Remove Sk3DShader::fKillProc and SkAutoCallProc. Both of their
behaviors have been moved into SkSmallAllocator (SkAutoCallProc was
unnecessary anyway, because the only time we ever used it we also
called detach(), so its auto behavior never happened).
Create the Sk3DShader on the stack, if there's room.
Remove the helper version of Choose, which was unused.

SmallAllocatorTest:
Test for the new class.

The rest:
Use SkSmallAllocator.

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

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/179343005

git-svn-id: http://skia.googlecode.com/svn/trunk@13696 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-07 03:24:41 +00:00
commit-bot@chromium.org
fab349c0bf remove SK_SUPPORT_DEEPCOPYTO_CONFIG code -- no longer used
R=reed@google.com
TBR=bsalomon@google.com

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/183763035

git-svn-id: http://skia.googlecode.com/svn/trunk@13664 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-05 02:34:58 +00:00
commit-bot@chromium.org
085a6e476b Rename test files to end with Test.cpp.
DM builds all of {bench,gm,test}/*.cpp.  A Windows build warned us that we were
trying to link typeface.obj twice.  This must have something to do with there
existing gm/typeface.cpp and tests/Typeface.cpp.  To be safe, make sure tests
have a Test.cpp suffix to disambiguate.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/185923002

git-svn-id: http://skia.googlecode.com/svn/trunk@13644 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-03 19:23:28 +00:00
commit-bot@chromium.org
4fcc3ca411 Add GrSet class built on top of RedBlackTree
BUG=skia:
R=bsalomon@google.com

Author: egdaniel@google.com

Review URL: https://codereview.chromium.org/176903003

git-svn-id: http://skia.googlecode.com/svn/trunk@13616 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-02-27 20:23:22 +00:00
commit-bot@chromium.org
0dc5bd149a Let DM run unit tests.
- refactor GYPs and a few flags
  - make GPU tests grab a thread-local GrContextFactory when needed as we do in DM for GMs
  - add a few more UI features to make DM more like tests

I believe this makes the program 'tests' obsolete.

It should be somewhat faster to run the two sets together than running the old binaries serially:
  - serial: tests 20s (3m18s CPU), dm 21s (3m01s CPU)
  - together: 27s (6m21s CPU)

Next up is to incorporate benches.  I'm only planning there on a single-pass sanity check, so that won't obsolete the program 'bench' just yet.

Tested: out/Debug/tests && out/Debug/dm && echo ok
BUG=skia:

Committed: http://code.google.com/p/skia/source/detail?r=13586

R=reed@google.com, bsalomon@google.com, mtklein@google.com, tfarina@chromium.org

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/178273002

git-svn-id: http://skia.googlecode.com/svn/trunk@13592 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-02-26 16:31:22 +00:00
commit-bot@chromium.org
79e13260cf Revert of Let DM run unit tests. (https://codereview.chromium.org/178273002/)
Reason for revert:
broke tests

Original issue's description:
> Let DM run unit tests.
>   - refactor GYPs and a few flags
>   - make GPU tests grab a thread-local GrContextFactory when needed as we do in DM for GMs
>   - add a few more UI features to make DM more like tests
>
> I believe this makes the program 'tests' obsolete.
>
> It should be somewhat faster to run the two sets together than running the old binaries serially:
>   - serial: tests 20s (3m18s CPU), dm 21s (3m01s CPU)
>   - together: 27s (6m21s CPU)
>
> Next up is to incorporate benches.  I'm only planning there on a single-pass sanity check, so that won't obsolete the program 'bench' just yet.
>
> Tested: out/Debug/tests && out/Debug/dm && echo ok
> BUG=skia:
>
> Committed: http://code.google.com/p/skia/source/detail?r=13586

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/179403010

git-svn-id: http://skia.googlecode.com/svn/trunk@13587 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-02-25 20:02:09 +00:00
commit-bot@chromium.org
6bd250a2a3 Let DM run unit tests.
- refactor GYPs and a few flags
  - make GPU tests grab a thread-local GrContextFactory when needed as we do in DM for GMs
  - add a few more UI features to make DM more like tests

I believe this makes the program 'tests' obsolete.

It should be somewhat faster to run the two sets together than running the old binaries serially:
  - serial: tests 20s (3m18s CPU), dm 21s (3m01s CPU)
  - together: 27s (6m21s CPU)

Next up is to incorporate benches.  I'm only planning there on a single-pass sanity check, so that won't obsolete the program 'bench' just yet.

Tested: out/Debug/tests && out/Debug/dm && echo ok
BUG=skia:
R=reed@google.com, bsalomon@google.com, mtklein@google.com, tfarina@chromium.org

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/178273002

git-svn-id: http://skia.googlecode.com/svn/trunk@13586 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-02-25 19:32:15 +00:00