aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkCanvas.cpp
Commit message (Collapse)AuthorAge
* remove deprecated getViewport/setViewportGravatar reed@google.com2011-05-04
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1235 2bbb7eff-a529-9590-31e7-b0007b416f81
* make SkDeviceFactory reference countedGravatar mike@reedtribe.org2011-04-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1180 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SkCanvas::clear(SkColor color) to call the new virtual clear on device.Gravatar reed@google.com2011-04-14
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1131 2bbb7eff-a529-9590-31e7-b0007b416f81
* add init() to SkTLazy to create a default instanceGravatar mike@reedtribe.org2011-04-10
| | | | | | | | use SkLazyPaint in internalDrawBitmap git-svn-id: http://skia.googlecode.com/svn/trunk@1093 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix infinite loop if we have a drawfilter but no drawlooperGravatar mike@reedtribe.org2011-04-08
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1079 2bbb7eff-a529-9590-31e7-b0007b416f81
* Simplify drawloopers and drawfilters. This allows the canvas to keep itsGravatar reed@google.com2011-04-07
| | | | | | | | | promise that const SkPaint& stay const (so we don't have bugs if a const paint is referenced from two threads in pictures) git-svn-id: http://skia.googlecode.com/svn/trunk@1074 2bbb7eff-a529-9590-31e7-b0007b416f81
* use new template class SkTLazy for deferred paint initializationGravatar reed@google.com2011-04-06
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1070 2bbb7eff-a529-9590-31e7-b0007b416f81
* add getTopLayer(), so clients don't have to use a LayerIter just to getGravatar reed@google.com2011-03-30
| | | | | | | | the top. (very common for chrome) git-svn-id: http://skia.googlecode.com/svn/trunk@1016 2bbb7eff-a529-9590-31e7-b0007b416f81
* abort drawing if srcRect is outside of the bitmap boundsGravatar reed@google.com2011-03-17
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@951 2bbb7eff-a529-9590-31e7-b0007b416f81
* add filterTextFlags() to SkDevice (virtual) to allow device subclasses toGravatar reed@google.com2011-03-15
| | | | | | | | | filter what text features we try to use. The filtering allows for implementation limitations to dictate when we turn off certain text features. git-svn-id: http://skia.googlecode.com/svn/trunk@943 2bbb7eff-a529-9590-31e7-b0007b416f81
* Upstreaming changes from android.Gravatar djsollen@google.com2011-03-14
| | | | | | | | | | - fix compile warnings in the GPU code - upstream android specific code (ifdef protected) - fail gracefully when a custom allocator fails git-svn-id: http://skia.googlecode.com/svn/trunk@936 2bbb7eff-a529-9590-31e7-b0007b416f81
* add origin to deviceGravatar reed@google.com2011-03-04
| | | | | | | | used for interpreting the clipstack when a device is a layer git-svn-id: http://skia.googlecode.com/svn/trunk@894 2bbb7eff-a529-9590-31e7-b0007b416f81
* Our region blitter (invoked by region::setPath()) must have its scanlinesGravatar reed@google.com2011-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fed to it in scanline order (Y sorted, then X sorted). If, however, we call rgn->setPath(path, otherRgn) with path in inverse mode, then our scan converter code looks like this: if (inverse) blit_top scan_convert_path if (inverse) blit_bottom This is fine, unless otherRgn is complex. If it is, then blit_top will want to efficiently "blit" otherRgn (the part above the path), and that means calling blitRect in an iterator. That can result in chunks being passed to our blitter (which is really accumulating scanlines) out of scanline order. The change is to detect that otherRgn is complex, and if it is, just perform the op in two steps: 1. setPath on a tmp region, limited by the bounds of otherRgn (simple) 2. intersect this tmp region with the currRgn. This is effectively what we do for non-intersect ops. Intersect was different only because we could (sometimes) avoid the step of create a tmp region. git-svn-id: http://skia.googlecode.com/svn/trunk@879 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add support for clipstack to Gr. GrClip is now a list of rects and paths ↵Gravatar bsalomon@google.com2011-03-03
| | | | | | with set operations to combine them. The stencil buffer is used to perform the set operations to put the clip into the stencil buffer. Building Gr's clip from Skia's clipStack is currently disabled due to the fact that Skia's clipStack is relative to the root layer not the current layer. This will be fixed in a subsequent CL. git-svn-id: http://skia.googlecode.com/svn/trunk@878 2bbb7eff-a529-9590-31e7-b0007b416f81
* disable assert on validateClip in default build for nowGravatar reed@google.com2011-02-24
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@846 2bbb7eff-a529-9590-31e7-b0007b416f81
* add fClipStack optional field to SkDraw (it is always set by canvas)Gravatar reed@google.com2011-02-23
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@844 2bbb7eff-a529-9590-31e7-b0007b416f81
* set the rgn to empty if the clipstack says empty (in our validate routine)Gravatar reed@google.com2011-02-23
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@843 2bbb7eff-a529-9590-31e7-b0007b416f81
* refactor to use a shared function (clipPathHelper) betweenGravatar reed@google.com2011-02-23
| | | | | | | | SkCanvas::clipPath() and SkCanvas::validateClip(). git-svn-id: http://skia.googlecode.com/svn/trunk@840 2bbb7eff-a529-9590-31e7-b0007b416f81
* change virtual setMatrixClip() to take a SkClipStack parameter.Gravatar reed@google.com2011-02-22
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@831 2bbb7eff-a529-9590-31e7-b0007b416f81
* add clipstack to canvas. not used yet, but will be for devices (e.g. gpu) thatGravatar reed@google.com2011-02-22
| | | | | | | | want to see how the clip was built git-svn-id: http://skia.googlecode.com/svn/trunk@824 2bbb7eff-a529-9590-31e7-b0007b416f81
* rename SkDeque::Iter to SkDeque::F2BIter, since it runs front-to-back (in ↵Gravatar reed@google.com2011-02-22
| | | | | | | | | | | | preparation for another iter that runs back-to-front (B2FIter). add unittest for Deque git-svn-id: http://skia.googlecode.com/svn/trunk@821 2bbb7eff-a529-9590-31e7-b0007b416f81
* Proposed fix for crash in Cr70244.Gravatar wjmaclean@chromium.org2011-02-07
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@764 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove SkRefCnt safeRef() and safeUnref(), and replace the call-sites withGravatar reed@google.com2011-02-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SkSafeRef() and SkSafeUnref(). This is basically a bug waiting to happen. An optimizing compiler can remove checks for null on "this" if it chooses. However, SkRefCnt::safeRef() relies on precisely this check... void SkRefCnt::safeRef() { if (this) { this->ref(); } } Since a compiler might skip the if-clause, it breaks the intention of this method, hence its removal. static inline void SkSafeRef(SkRefCnt* obj) { if (obj) { obj->ref(); } } This form is not ignored by an optimizing compile, so we use it instead. git-svn-id: http://skia.googlecode.com/svn/trunk@762 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove debugging code around gUseExtGravatar reed@google.com2011-01-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@735 2bbb7eff-a529-9590-31e7-b0007b416f81
* If you #define SK_ALLOW_OVER_32K_BITMAPS, then skia will try to draw bitmapsGravatar reed@google.com2011-01-13
| | | | | | | | | | whose dimensions exceed 32K. In my testing, this is fine, but I'm coding this as an opt-in feature for now, to allow for more testing before its enabled by default. git-svn-id: http://skia.googlecode.com/svn/trunk@693 2bbb7eff-a529-9590-31e7-b0007b416f81
* git-svn-id: http://skia.googlecode.com/svn/trunk@685 ↵Gravatar reed@google.com2011-01-11
| | | | 2bbb7eff-a529-9590-31e7-b0007b416f81
* add getter/setter for device-factory on canvasGravatar reed@google.com2011-01-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@683 2bbb7eff-a529-9590-31e7-b0007b416f81
* add gpu to gm toolGravatar reed@google.com2010-12-23
| | | | | | | | add pass-through read/write pixels API to canvas git-svn-id: http://skia.googlecode.com/svn/trunk@660 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove ZLIB include from SkUserConfig for how (doesn't work on mac ↵Gravatar reed@google.com2010-12-20
| | | | | | | | | | | | sampleapp) but, add it to Makefile if SKIA_PDF_SUPPORT is true Use compile_assert (yea!) git-svn-id: http://skia.googlecode.com/svn/trunk@643 2bbb7eff-a529-9590-31e7-b0007b416f81
* merge with changes for GPU backendGravatar reed@android.com2010-12-20
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@637 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move the device capability method to SkDevice.Gravatar vandebo@chromium.org2010-10-26
| | | | | | | | These are not the capabilities of the factory, but of the device. Additionally, it is more often needed when you have a device then when you have a factory, which caused creating of a new factory. Review URL: http://codereview.appspot.com/2720041 git-svn-id: http://skia.googlecode.com/svn/trunk@618 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix SkDraw::validate to work with vector Devices.Gravatar vandebo@chromium.org2010-10-26
| | | | | | | | Vector devices don't have a (valid) fBitmap, so pass in width and height. Review URL: http://codereview.appspot.com/2718041 git-svn-id: http://skia.googlecode.com/svn/trunk@616 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix a memory leak in the new Canvas/Device workflow.Gravatar vandebo@chromium.org2010-10-15
| | | | | | | | The previous change made it difficult to inherit from SkCanvas without leaking memory. By making SkDeviceFactory not reference counted, the right thing happens more naturally, just NewCanvas : public SkCanvas(new NewDeviceFactory()) {...} Review URL: http://codereview.appspot.com/2530042 git-svn-id: http://skia.googlecode.com/svn/trunk@605 2bbb7eff-a529-9590-31e7-b0007b416f81
* Refactor SkCanvas so that backends don't need to override it.Gravatar vandebo@chromium.org2010-10-13
| | | | | | | | Methods or classes that should go away are marked deprecated. The only thing I know of that breaks backward compatibility is SkCanvas((SkDevice*)NULL), but that is fairly unlikely to occur in the wild because that constructor had a default value of NULL. Review URL: http://codereview.appspot.com/2103045 git-svn-id: http://skia.googlecode.com/svn/trunk@604 2bbb7eff-a529-9590-31e7-b0007b416f81
* respect edgetype in quickrejectGravatar reed@android.com2010-02-05
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@489 2bbb7eff-a529-9590-31e7-b0007b416f81
* Initialise fDeviceCMDirtyGravatar agl@chromium.org2009-12-12
| | | | | | http://codereview.appspot.com/176050 git-svn-id: http://skia.googlecode.com/svn/trunk@457 2bbb7eff-a529-9590-31e7-b0007b416f81
* add drawData() to canvas, to record data blobsGravatar reed@android.com2009-12-04
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@452 2bbb7eff-a529-9590-31e7-b0007b416f81
* clean up fix to drawBitmapRectGravatar reed@android.com2009-10-16
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@388 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix drawBitmapRect to not clip the src rect when computing the matrixGravatar reed@android.com2009-10-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@387 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix quickReject() to handle perspective correctly (i.e. transform forward intoGravatar reed@android.com2009-07-21
| | | | | | | | dst-space, and perform the clip-test there). git-svn-id: http://skia.googlecode.com/svn/trunk@274 2bbb7eff-a529-9590-31e7-b0007b416f81
* detect nearly translate-only matrices when drawing bitmaps (for speed)Gravatar reed@android.com2009-06-24
| | | | | | | | | rename setXfermode(Mode) to setXfermodeMode(Mode) for sanity fix memory leak in setXfermode(Mode) git-svn-id: http://skia.googlecode.com/svn/trunk@239 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove deprecated use of porterduff enumGravatar reed@android.com2009-06-23
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@235 2bbb7eff-a529-9590-31e7-b0007b416f81
* only call SkDevice::gainFocus() if we're actually drawing to a different device.Gravatar reed@android.com2009-06-10
| | | | | | | | Saves overhead when using GL. git-svn-id: http://skia.googlecode.com/svn/trunk@207 2bbb7eff-a529-9590-31e7-b0007b416f81
* init bounds to empty if we return false from getClipBounds()Gravatar reed@android.com2009-05-18
| | | | | | | | | We were already doing that in one place (empty clip), but now we do it in the other as well (matrix not invertible). git-svn-id: http://skia.googlecode.com/svn/trunk@179 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SkSize for dimensionsGravatar reed@android.com2009-05-13
| | | | | | | | | add SkShape baseclass, in the hopes of having SkPicture inherit from that, and also using shapes as the extension mechanism for things like animated-gif git-svn-id: http://skia.googlecode.com/svn/trunk@174 2bbb7eff-a529-9590-31e7-b0007b416f81
* API change: SkPath computeBounds -> getBoundsGravatar reed@android.com2009-04-01
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@140 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SkChunkAlloc::unalloc() to undo the last allocation, useful if the ↵Gravatar reed@android.com2009-03-30
| | | | | | | | | | | caller wants to treat the allocats like temp memory (see PictureRecord) Call unalloc if a paint (or other cached object) is already in our list for picture recording Use correct CompareType macro in SkCanvas::quickReject git-svn-id: http://skia.googlecode.com/svn/trunk@138 2bbb7eff-a529-9590-31e7-b0007b416f81
* explicitly call "our" version of clipPath in the case when clipRect needs toGravatar reed@android.com2009-03-02
| | | | | | | | | turn itself into a path when the matrix rotates. This avoids infinite recursion when the canvas is subclassed (e.g. SkPicture's recording canvas). git-svn-id: http://skia.googlecode.com/svn/trunk@100 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove white-spaceGravatar reed@android.com2009-02-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@91 2bbb7eff-a529-9590-31e7-b0007b416f81
* check for non-invertible matrices in getClipBounds()Gravatar reed@android.com2009-02-06
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@89 2bbb7eff-a529-9590-31e7-b0007b416f81