reed
9fa60daad4
Simplify flattening to just write enough to call the factory/public-constructor for the class. We want to *not* rely on private constructors, and not rely on calling through the inheritance hierarchy for either flattening or unflattening(CreateProc).
...
Refactoring pattern:
1. guard the existing constructor(readbuffer) with the legacy build-flag
2. If you are a instancable subclass, implement CreateProc(readbuffer) to create a new instances from the buffer params (or return NULL).
If you're a shader subclass
1. You must read/write the local matrix if your class accepts that in its factory/constructor, else ignore it.
R=robertphillips@google.com , mtklein@google.com , senorblanco@google.com , senorblanco@chromium.org , sugoi@chromium.org
Author: reed@google.com
Review URL: https://codereview.chromium.org/395603002
2014-08-21 07:59:51 -07:00
scroggo
65044bfe02
Return NULL when building empty LayerRasterizer.
...
In SkLayerRasterizer::snapshotRasterizer() and ::detachRasterizer(),
if no layers have been added, do not attempt to create an
SkLayerRasterizer. Instead, return NULL.
This fixes an error when running tests on Android.
Update dox to state that NULL may be returned.
Add tests.
R=reed@google.com
Author: scroggo@google.com
Review URL: https://codereview.chromium.org/313653006
2014-06-03 13:12:51 -07:00
commit-bot@chromium.org
55c9b4e9f6
Cast int to float.
...
Get rid of warning->error.
TBR=reed@google.com
NOTRY=true
NOTREECHECKS=true
Author: scroggo@google.com
Review URL: https://codereview.chromium.org/233883002
git-svn-id: http://skia.googlecode.com/svn/trunk@14140 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-10 21:09:33 +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