aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
Commit message (Collapse)AuthorAge
* create and modify matrices in luaGravatar reed2014-10-14
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/651823004
* add fade_slide transition to lua slidesGravatar reed2014-10-12
| | | | | | | TBR= BUG=skia: Review URL: https://codereview.chromium.org/646613004
* add key handlers to luaGravatar reed2014-10-11
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/652473002
* allow for lua click handlersGravatar reed2014-10-11
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/649013002
* move test for lua into separate resource fileGravatar reed2014-10-10
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/645283002
* add drawImageRect to lua, update sampleGravatar reed2014-10-10
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/642353005
* Draw more accurate thick-stroked Beziers (disabled)Gravatar caryclark2014-10-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Draw thick-stroked Beziers by computing the outset quadratic, measuring the error, and subdividing until the error is within a predetermined limit. To try this CL out, change src/core/SkStroke.h:18 to #define QUAD_STROKE_APPROXIMATION 1 or from the command line: CPPFLAGS="-D QUAD_STROKE_APPROXIMATION=1" ./gyp_skia Here's what's in this CL: bench/BezierBench.cpp : a microbench for examining where the time is going gm/beziers.cpp : random Beziers with various thicknesses gm/smallarc.cpp : a distillation of bug skia:2769 samplecode/SampleRotateCircles.cpp : controls added for error, limit, width src/core/SkStroke.cpp : the new stroke implementation (disabled) tests/StrokerTest.cpp : a stroke torture test that checks normal and extreme values The new stroke algorithm has a tweakable parameter: stroker.setError(1); (SkStrokeRec.cpp:112) The stroke error is the allowable gap between the midpoint of the stroke quadratic and the center Bezier. As the projection from the quadratic approaches the endpoints, the error is decreased proportionally so that it is always inside the quadratic curve. An overview of how this works: - For a given T range of a Bezier, compute the perpendiculars and find the points outset and inset for some radius. - Construct tangents for the quadratic stroke. - If the tangent don't intersect between them (may happen with cubics), subdivide. - If the quadratic stroke end points are close (again, may happen with cubics), draw a line between them. - Compute the quadratic formed by the intersecting tangents. - If the midpoint of the quadratic is close to the midpoint of the Bezier perpendicular, return the quadratic. - If the end of the stroke at the Bezier midpoint doesn't intersect the quad's bounds, subdivide. - Find where the Bezier midpoint ray intersects the quadratic. - If the intersection is too close to the quad's endpoints, subdivide. - If the error is large proportional to the intersection's distance to the quad's endpoints, subdivide. BUG=skia:723,skia:2769 Review URL: https://codereview.chromium.org/558163005
* use SkDocument to capture pdfs from SampleApp 'e'Gravatar reed2014-10-08
| | | | | | | | BUG=skia: TBR= NOTRY=True Review URL: https://codereview.chromium.org/634293004
* GrContext::copyTexture->GrContext::copySurface.Gravatar bsalomon2014-10-07
| | | | | | | | | | | | Add a flush writes pixel ops flag. Add an explicit flush writes for GrSurface. BUG=skia:2977 Committed: https://skia.googlesource.com/skia/+/cf99b00980b6c9c557e71abf1a7c9f9b21217262 Review URL: https://codereview.chromium.org/622663002
* extra call to flush until brian can figure it outGravatar reed2014-10-07
| | | | | | | BUG=skia: TBR=bsalomon@google.com Review URL: https://codereview.chromium.org/633643004
* add surfaceprops to SkWindow, and 'D' to toggle distancefieldfontsGravatar reed2014-10-06
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/631943002
* remove unused TextBufferDirection enumGravatar reed2014-10-03
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/621403002
* Revert of GrContext::copyTexture->GrContext::copySurface. Add a flush writes ↵Gravatar bsalomon2014-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | pixel ops flag. (patchset #3 id:40001 of https://codereview.chromium.org/622663002/) Reason for revert: Breaking GMs on some bots Original issue's description: > GrContext::copyTexture->GrContext::copySurface. > > Add a flush writes pixel ops flag. > > Add an explicit flush writes for GrSurface. > > BUG=skia:2977 > > Committed: https://skia.googlesource.com/skia/+/cf99b00980b6c9c557e71abf1a7c9f9b21217262 TBR=robertphillips@google.com NOTREECHECKS=true NOTRY=true BUG=skia:2977 Review URL: https://codereview.chromium.org/621073002
* GrContext::copyTexture->GrContext::copySurface.Gravatar bsalomon2014-10-02
| | | | | | | | | | Add a flush writes pixel ops flag. Add an explicit flush writes for GrSurface. BUG=skia:2977 Review URL: https://codereview.chromium.org/622663002
* remove alphatype from colortableGravatar reed2014-09-29
| | | | | | | | | | | the owning bitmap is (already) responsible for knowing the alphatype BUG=skia: R=djsollen@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/611093002
* SkCanvas::drawImage is the new way for drawing a SkImage to a CanvasGravatar piotaixr2014-09-24
| | | | | | | | | | | | BUG=skia:2947 Committed: https://skia.googlesource.com/skia/+/432789972c1e1f8a66165c75a250dba1853efa08 R=junov@chromium.org, reed@google.com, bsalomon@google.com Author: piotaixr@chromium.org Review URL: https://codereview.chromium.org/583453002
* Revert of SkCanvas::drawImage is the new way for drawing an SkImage to a ↵Gravatar borenet2014-09-24
| | | | | | | | | | | | | | | | | | | | | | | | | | Canvas (patchset #9 id:160001 of https://codereview.chromium.org/583453002/) Reason for revert: Broke ChromiumOS Ozone builder: http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Ozone%20Builder/builds/4087/steps/compile/logs/stdio Reverting to unblock DEPS roll. Original issue's description: > SkCanvas::drawImage is the new way for drawing a SkImage to a Canvas > > BUG=skia:2947 > > Committed: https://skia.googlesource.com/skia/+/432789972c1e1f8a66165c75a250dba1853efa08 R=junov@chromium.org, reed@google.com, bsalomon@google.com, piotaixr@chromium.org TBR=bsalomon@google.com, junov@chromium.org, piotaixr@chromium.org, reed@google.com NOTREECHECKS=true NOTRY=true BUG=skia:2947 Author: borenet@google.com Review URL: https://codereview.chromium.org/598133002
* SkCanvas::drawImage is the new way for drawing a SkImage to a CanvasGravatar piotaixr2014-09-23
| | | | | | | | | BUG=skia:2947 R=junov@chromium.org, reed@google.com, bsalomon@google.com Author: piotaixr@chromium.org Review URL: https://codereview.chromium.org/583453002
* enable conservative clips for gpudeviceGravatar reed2014-09-19
| | | | | | | | TBR=bsalomon Author: reed@google.com Review URL: https://codereview.chromium.org/587793003
* use surface in SkView/SampleAppGravatar reed2014-09-18
| | | | | | | | | BUG=skia: R=bsalomon@google.com, robertphillips@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/580073003
* "NULL !=" = NULLGravatar bsalomon2014-09-05
| | | | | | | | R=reed@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/544233002
* Change SkPicture::draw to playbackGravatar robertphillips2014-09-04
| | | | | | | | R=reed@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/540963002
* Hide fields in SkImageInfoGravatar reed2014-09-03
| | | | | | | | | R=rmistry@google.com TBR=bsalomon Author: reed@google.com Review URL: https://codereview.chromium.org/536003002
* make allocPixels throw on failureGravatar reed2014-09-02
| | | | | | | | | BUG=skia: R=mtklein@google.com, fmalita@google.com, fmalita@chromium.org Author: reed@google.com Review URL: https://codereview.chromium.org/510423005
* Try out scalar picture sizesGravatar robertphillips2014-08-29
| | | | | | | | | | This paves the way for removing the 'fTile' parameter from SkPictureShader (although that should be a different CL). If we like this we could also move to providing an entire cull SkRect. R=reed@google.com, mtklein@google.com, fmalita@google.com, fmalita@chromium.org Author: robertphillips@google.com Review URL: https://codereview.chromium.org/513983002
* Make SkGpuDevice constructors private.Gravatar bsalomon2014-08-28
| | | | | | | | R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/517033002
* Remove SkQuadTree.Gravatar mtklein2014-08-26
| | | | | | | | | | | | | | We're not testing it to the same degree we do RTree and TileGrid. Any changes we'll make to BBH APIs become 33% easier without it. If find we want it again, we can always resurrect it. BUG=skia:1021,skia:2834 R=robertphillips@google.com, mtklein@google.com TBR=reed Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/500373005
* remove (unused) scale parameter from measureTextGravatar reed2014-08-26
| | | | | | | | | BUG=skia: R=bungeman@google.com, djsollen@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/510433002
* Simplify flattening to just write enough to call the ↵Gravatar reed2014-08-21
| | | | | | | | | | | | | | | | | | 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
* add an animated test to verify that high-quality identity scaling doesn't ↵Gravatar humper2014-08-08
| | | | | | | | | | | change the image BUG=skia: R=reed@google.com Author: humper@google.com Review URL: https://codereview.chromium.org/454913002
* parameterize tesselation paramsGravatar reed2014-08-06
| | | | | | | | | TBR= NOTREECHECKS=True Author: reed@google.com Review URL: https://codereview.chromium.org/446913002
* fix hittest in Patch sampleGravatar reed2014-08-06
| | | | | | | | | TBR= BUG=skia: Author: reed@google.com Review URL: https://codereview.chromium.org/441373002
* Add standard fonts to all GMs.Gravatar Cary Clark2014-07-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow GM results to be compared across machines and platforms by standardizing the fonts used by all tests. This adds runtime flags to DM to use either the system font context (the default), the fonts in the resources directory ( --resourceFonts ) or a set of canonical paths generated from the fonts ( --portableFonts ). This CL should leave the current DM results unchanged by default. If the portable font data or resource font is missing when DM is run, it falls back to using the system font context. The create_test_font tool generates the paths and metrics read by DM with the --portableFonts flag set, and generates the font substitution tables read by DM with the --resourceFonts flag set. If DM is run in SkDebug mode with the --reportUsedChars flag set, it generates the corresponding data compiled into the create_test_font tool. All GM tests set their typeface information by calling either sk_tool_utils::set_portable_typeface or sk_tool_utils::portable_typeface . (The former takes the paint, the latter returns a SkTypeface.) These calls can be removed in the future when the Font Manager can be superceded. BUG=skia:2687 R=mtklein@google.com Review URL: https://codereview.chromium.org/407183003
* Cleanup: Rename SkOSPath functions.Gravatar tfarina2014-07-28
| | | | | | | | | | | | | | | | Mostly for brevity and matches better with Python: Python | Old C++ | New C++ os.path.join | SkOSPath::SkPathJoin | SkOSPath::Join os.path.basename | SkOSPath::SkBasename | SkOSPath::Basename BUG=None TEST=make all R=mtklein@google.com, bsalomon@google.com Author: tfarina@chromium.org Review URL: https://codereview.chromium.org/428443002
* Remove the single-sigma version of SkDropShadowImageFilter::Create().Gravatar senorblanco2014-07-22
| | | | | | | | | | | It's no longer used in Chrome. BUG=skia: R=bsalomon@google.com Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/407203002
* share dm and command flagsGravatar caryclark2014-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* git sample app working on iOSGravatar caryclark2014-07-18
| | | | | | | | R=jvanverth@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/405653002
* remove dead code from sampleGravatar reed2014-07-15
| | | | | | | | TBR= Author: reed@google.com Review URL: https://codereview.chromium.org/393063002
* Remove SkPicture copy constructorGravatar robertphillips2014-07-13
| | | | | | | | | | Given where we're heading with SkPicture why would you need to make a copy? R=reed@google.com, mtklein@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/381133002
* Handle NULL typeface in SampleApp.Gravatar Ben Wagner2014-07-10
| | | | | It is possible that SampleApp will use the NULL typeface as the default. This is valid and should be handled properly on shutdown.
* Cleanup usage of GetResourcePath() after commit ↵Gravatar tfarina2014-07-01
| | | | | | | | | | | | | | | | | bcbc1788b478b1e54079318ad073e8490aa66fae. There was a clean up opportunity left over after https://skia.googlesource.com/skia/+/bcbc1788b478b1e54079318ad073e8490aa66fae, that could make use of the default parameter of GetResourcePath() function to make some call sites cleaner. We decided to make it in a separate CL to make reviewer's and author's life easier, so we could catch errors and/or mistakes easily. BUG=None TEST=make all && out/Debug/dm && out/Debug/SampleApp R=mtklein@google.com Author: tfarina@chromium.org Review URL: https://codereview.chromium.org/351133003
* stop calling SkCanvas::getDeviceGravatar reed2014-06-30
| | | | | | | | | BUG=skia: R=bsalomon@google.com, robertphillips@google.com, junov@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/355193006
* remove unnecessary bitmapdevice referencesGravatar reed2014-06-27
| | | | | | | | TBR= Author: reed@google.com Review URL: https://codereview.chromium.org/354143004
* Remove SkBicubicImageFilter, and all related tests.Gravatar senorblanco2014-06-25
| | | | | | | | | | | | | Now that we have SkResizeImageFilter, and the bicubic resizing is part of skia proper, there's no need for a specialized image filter. BUG=skia: R=bsalomon@google.com Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/357793002
* use platform-independent font for gmGravatar caryclark2014-06-23
| | | | | | | | | | | | | | Create a custom typeface and scaler to render simple paths the same on all platforms. GM tests are modified to explicitly select the custom typeface. R=reed@google.com, mtklein@google.com, bungeman@google.com TBR=reed Author: caryclark@google.com Review URL: https://codereview.chromium.org/348323003
* Port SampleApp to SkCommandLineFlags.Gravatar mtklein2014-06-19
| | | | | | | | | BUG=skia: R=bsalomon@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/344873004
* Refactor how we handle resources path in Tests.Gravatar tfarina2014-06-18
| | | | | | | | | | | | | This idea emerged while doing https://codereview.chromium.org/321723002/ (commit 880914c35c8f7fc2e9c57134134c883baf66e538). BUG=None TEST=make tests && out/Debug/tests R=mtklein@google.com Author: tfarina@chromium.org Review URL: https://codereview.chromium.org/346453002
* hide SkBitmap::Config entirely (behind a flag)Gravatar reed2014-06-17
| | | | | | | | | | | | | patch from issue 339463002 TBR= I think the NoGPU failure is unrelated, so ignoring NOTRY=True Author: reed@google.com Review URL: https://codereview.chromium.org/340533002
* hide Config in SkImageDecoder -- use SkColorType insteadGravatar reed2014-06-12
| | | | | | | | | | patch from issue 334613003 TBR=scroggo Author: reed@chromium.org Review URL: https://codereview.chromium.org/334793002
* Alter SkCanvas::drawPicture (devirtualize, take const SkPicture, take pointer)Gravatar robertphillips2014-06-04
| | | | | | | | R=reed@google.com, bsalomon@google.com, mtklein@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/313613004