aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkClipStack.h
Commit message (Collapse)AuthorAge
* Add dump() to SkClipStack to help with debugging.Gravatar bsalomon2014-06-09
| | | | | | | | R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/311263015
* SkClipStack::Element tweaks.Gravatar fmalita2014-06-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | ( This is intended to facilitate efficient kMatrix_SaveFlags emulation on restore(): * collect all clip stack elements for the current save count into a side clip stack * canvas.restore(everything) * replay the collected clip ops to restore the initial clip state => we restored the matrix but the clip state is unchanged ) Two main changes: * expose the save count for SkClipStack::Element * expose a replay method for the same (logic relocated from SkCanvas::replayClips) The SkCanvas::ClipVisitor shuffling is to enable forward decl in SkClipStack.h (cannot fwdecl a nested class). R=reed@google.com, robertphillips@google.com TBR=reed@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/269693003
* Use SkTLazy to hold path in SkClipStack::ElementGravatar commit-bot@chromium.org2014-02-27
| | | | | | | | | | R=reed@google.com, robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/178583002 git-svn-id: http://skia.googlecode.com/svn/trunk@13610 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use SkRRect to store rects in SkClipStack::ElementGravatar commit-bot@chromium.org2014-02-21
| | | | | | | | | | | BUG=skia:2181 R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/163483003 git-svn-id: http://skia.googlecode.com/svn/trunk@13544 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix calling undef inline func build errorGravatar commit-bot@chromium.org2014-02-16
| | | | | | | | | | | | | Fixes error introduced in https://code.google.com/p/skia/source/detail?r=13465 R=robertphillips@google.com TBR=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/168893002 git-svn-id: http://skia.googlecode.com/svn/trunk@13466 2bbb7eff-a529-9590-31e7-b0007b416f81
* Store SkRRects in SkClipStackGravatar commit-bot@chromium.org2014-02-16
| | | | | | | | | | | BUG=skia:2181 R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/163683002 git-svn-id: http://skia.googlecode.com/svn/trunk@13465 2bbb7eff-a529-9590-31e7-b0007b416f81
* Avoid re-rendering stencil clip for every draw with reducable clip stackGravatar commit-bot@chromium.org2013-11-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the cases where clip stack reduction would cause clip to be re-rendered to stencil for each draw call. This causes unneeded slowdown. Stencil cache would not be used because the clip stack generation id communicated by the clip stack element list would be invalid. This happended due to a) clip stack reduction creating new elements in the element list. b) purging logic removing the generation id, but reduction logic selecting already purged element, and thus the generation id, as the representative state of the clip. Cases of a) where reduction would flatten the stack to a single new element were fixed by assigning the generation id of the top-most element of the clip stack as the generation id of the new element. This is not strictly minimal, but enables more caching than using invalid id. Cases of a) where reduction would substitute a stack element with a new element the generation id of the substituted element is used. The b) part was fixed by removing the purging logic. It was not exactly correct, as the previously purged states were actually used. The purging was not used for anything. Changes SkClipStack API to highlight that invalid generation id is never returned by SkClipStack. Empty stacks are wide open. Changes the clients to reflect this. Fixes a crash when not passing anti-alias out parameter to GrReducedClip::ReduceClipStack. The crash is not exercised in the current code. Committed: http://code.google.com/p/skia/source/detail?r=12084 R=bsalomon@google.com, robertphillips@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/48593003 git-svn-id: http://skia.googlecode.com/svn/trunk@12127 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Avoid re-rendering stencil clip for every draw with reducable clip ↵Gravatar reed@google.com2013-11-01
| | | | | | | | | | | | | | | | stack" This reverts commit 92a7d4bf6a371f1f864154be902e8d86938e560b. Revert "fix mac 10.6 build" This reverts commit 114cd1a9f2734aaed6914718814364811b78bd7f. BUG= Review URL: https://codereview.chromium.org/54543008 git-svn-id: http://skia.googlecode.com/svn/trunk@12087 2bbb7eff-a529-9590-31e7-b0007b416f81
* Avoid re-rendering stencil clip for every draw with reducable clip stackGravatar commit-bot@chromium.org2013-11-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the cases where clip stack reduction would cause clip to be re-rendered to stencil for each draw call. This causes unneeded slowdown. Stencil cache would not be used because the clip stack generation id communicated by the clip stack element list would be invalid. This happended due to a) clip stack reduction creating new elements in the element list. b) purging logic removing the generation id, but reduction logic selecting already purged element, and thus the generation id, as the representative state of the clip. Cases of a) where reduction would flatten the stack to a single new element were fixed by assigning the generation id of the top-most element of the clip stack as the generation id of the new element. This is not strictly minimal, but enables more caching than using invalid id. Cases of a) where reduction would substitute a stack element with a new element the generation id of the substituted element is used. The b) part was fixed by removing the purging logic. It was not exactly correct, as the previously purged states were actually used. The purging was not used for anything. Changes SkClipStack API to highlight that invalid generation id is never returned by SkClipStack. Empty stacks are wide open. Changes the clients to reflect this. Fixes a crash when not passing anti-alias out parameter to GrReducedClip::ReduceClipStack. The crash is not exercised in the current code. R=bsalomon@google.com, robertphillips@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/48593003 git-svn-id: http://skia.googlecode.com/svn/trunk@12084 2bbb7eff-a529-9590-31e7-b0007b416f81
* Compact the clipstack for kReplace_Op'd geometryGravatar commit-bot@chromium.org2013-06-11
| | | | | | | | | | | | | | | | | | When adding a clip rect or clip path to the stack with the kReplace_Op operation, remove all previous elements within the same save frame (elements with fSaveCount equal to the current fSaveCount of the stack). This prevents unbounded growth of the clipstack for long-lived instances that gets reused. Addresses https://code.google.com/p/skia/issues/detail?id=748 R=robertphillips@google.com Author: fs@opera.com Review URL: https://chromiumcodereview.appspot.com/16160020 git-svn-id: http://skia.googlecode.com/svn/trunk@9502 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-01-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7406 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adding quickContains API method to SkClipStackGravatar junov@chromium.org2012-12-12
| | | | | | | | BUG=http://code.google.com/p/chromium/issues/detail?id=164580 TEST=unit test ClipStack/quickContains Review URL: https://codereview.appspot.com/6919044 git-svn-id: http://skia.googlecode.com/svn/trunk@6760 2bbb7eff-a529-9590-31e7-b0007b416f81
* Improve handling of inverse clip paths in GrClipMaskManager.Gravatar bsalomon@google.com2012-12-07
| | | | | | | | | Will require rebaselining of complexclip_aa and complexclip_aa_layer on GPU. R=robertphillips@google.com Review URL: https://codereview.appspot.com/6907052 git-svn-id: http://skia.googlecode.com/svn/trunk@6712 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make SkClipStack::Iter use SkClipStack::Element.Gravatar bsalomon@google.com2012-12-04
| | | | | | | R=robertphillips@google.com Review URL: https://codereview.appspot.com/6871051 git-svn-id: http://skia.googlecode.com/svn/trunk@6661 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2012-11-30
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6632 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove SkClipStack::Iter::combinedNext.Gravatar bsalomon@google.com2012-11-29
| | | | | | Review URL: https://codereview.appspot.com/6844114 git-svn-id: http://skia.googlecode.com/svn/trunk@6619 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make SkClipStack::Element public.Gravatar bsalomon@google.com2012-11-29
| | | | | | | R=robertphillips@google.com Review URL: https://codereview.appspot.com/6858096 git-svn-id: http://skia.googlecode.com/svn/trunk@6617 2bbb7eff-a529-9590-31e7-b0007b416f81
* Rename SkClipStack::Rec to SkClipStack::ElementGravatar bsalomon@google.com2012-11-29
| | | | | | | R=robertphillips@google.com Review URL: https://codereview.appspot.com/6854115 git-svn-id: http://skia.googlecode.com/svn/trunk@6605 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add a function that computes a reduced representation of the clip stack.Gravatar bsalomon@google.com2012-11-26
| | | | | | | Also adds a unit test. The function is not yet used other than in the test. Review URL: https://codereview.appspot.com/6855098 git-svn-id: http://skia.googlecode.com/svn/trunk@6553 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert 6351 due to bugs.Gravatar bsalomon@google.com2012-11-12
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6377 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2012-11-09
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6362 2bbb7eff-a529-9590-31e7-b0007b416f81
* Apply intersect rects to earlier clip elements and skip rects when possible.Gravatar bsalomon@google.com2012-11-08
| | | | | | | R=robertphillips@google.com Review URL: https://codereview.appspot.com/6814105 git-svn-id: http://skia.googlecode.com/svn/trunk@6351 2bbb7eff-a529-9590-31e7-b0007b416f81
* Combine multiple intersecting rects in SkClipStack::Iter.Gravatar bsalomon@google.com2012-11-07
| | | | | | | R=robertphillips@google.com Review URL: https://codereview.appspot.com/6816104 git-svn-id: http://skia.googlecode.com/svn/trunk@6339 2bbb7eff-a529-9590-31e7-b0007b416f81
* Some improvements to reduce the number of pixels touched in generating alpha ↵Gravatar bsalomon@google.com2012-11-07
| | | | | | | | clip masks Review URL: https://codereview.appspot.com/6828043 git-svn-id: http://skia.googlecode.com/svn/trunk@6329 2bbb7eff-a529-9590-31e7-b0007b416f81
* Minimize use of SkDraw's matrix in SkGpuDevice.Gravatar bsalomon@google.com2012-10-11
| | | | | | | R=robertphillips@google.com Review URL: https://codereview.appspot.com/6604068 git-svn-id: http://skia.googlecode.com/svn/trunk@5906 2bbb7eff-a529-9590-31e7-b0007b416f81
* Result of running tools/sanitize_source_files.py (which was added in ↵Gravatar rmistry@google.com2012-08-23
| | | | | | | | | https://codereview.appspot.com/6465078/) This CL is part I of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6485054 git-svn-id: http://skia.googlecode.com/svn/trunk@5262 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SkClipStack::clipEmpty() as an optimized way to say clipDevRect(empty, ↵Gravatar reed@google.com2012-08-16
| | | | | | | | | intersect) if the caller knows up-front that it wants the clipstact to become empty. Review URL: https://codereview.appspot.com/6443132 git-svn-id: http://skia.googlecode.com/svn/trunk@5127 2bbb7eff-a529-9590-31e7-b0007b416f81
* Added method of getting top genID from SkClipStackGravatar robertphillips@google.com2012-08-09
| | | | | | | | http://codereview.appspot.com/6446108/ git-svn-id: http://skia.googlecode.com/svn/trunk@5034 2bbb7eff-a529-9590-31e7-b0007b416f81
* Added SkClipStack portion of new clip mask caching systemGravatar robertphillips@google.com2012-08-07
| | | | | | | | http://codereview.appspot.com/6449089/ git-svn-id: http://skia.googlecode.com/svn/trunk@4978 2bbb7eff-a529-9590-31e7-b0007b416f81
* Replace GrClip with SkClipStackGravatar robertphillips@google.com2012-07-31
| | | | | | | | http://codereview.appspot.com/6449070/ git-svn-id: http://skia.googlecode.com/svn/trunk@4865 2bbb7eff-a529-9590-31e7-b0007b416f81
* Added dev- & canv- prefixes to Ganesh bounding boxes to indicate coordinate ↵Gravatar robertphillips@google.com2012-07-31
| | | | | | | | | | space http://codereview.appspot.com/6457061/ git-svn-id: http://skia.googlecode.com/svn/trunk@4856 2bbb7eff-a529-9590-31e7-b0007b416f81
* Added ctor to SkClipStack and isEmpty methodGravatar robertphillips@google.com2012-07-26
| | | | | | | | http://codereview.appspot.com/6444048/ git-svn-id: http://skia.googlecode.com/svn/trunk@4787 2bbb7eff-a529-9590-31e7-b0007b416f81
* Added isIntersectionOfRects to SkClipStackGravatar robertphillips@google.com2012-07-24
| | | | | | | | http://codereview.appspot.com/6434050/ git-svn-id: http://skia.googlecode.com/svn/trunk@4745 2bbb7eff-a529-9590-31e7-b0007b416f81
* Added bound computation to SkClipStackGravatar robertphillips@google.com2012-07-24
| | | | | | | | | | http://codereview.appspot.com/6419048/ This will require re-baselining of complexclip* and filltypespersp git-svn-id: http://skia.googlecode.com/svn/trunk@4730 2bbb7eff-a529-9590-31e7-b0007b416f81
* Made clarifying renamings to SkClipStack's iterators (and added to unit test)Gravatar robertphillips@google.com2012-07-20
| | | | | | | | http://codereview.appspot.com/6423051/ git-svn-id: http://skia.googlecode.com/svn/trunk@4692 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add skipToLast method to SkClipStackGravatar robertphillips@google.com2012-07-18
| | | | | | | | http://codereview.appspot.com/6411043/ git-svn-id: http://skia.googlecode.com/svn/trunk@4644 2bbb7eff-a529-9590-31e7-b0007b416f81
* Extended SkDeque's reverse iteration capability to SkClipStackGravatar robertphillips@google.com2012-07-16
| | | | | | | | http://codereview.appspot.com/6409046/ git-svn-id: http://skia.googlecode.com/svn/trunk@4631 2bbb7eff-a529-9590-31e7-b0007b416f81
* pass the region-op to the clipstack for SkCanvas::clipRegion.Gravatar reed@google.com2012-05-16
| | | | | | | | we were defaulting to intersect all the time (doh). git-svn-id: http://skia.googlecode.com/svn/trunk@3980 2bbb7eff-a529-9590-31e7-b0007b416f81
* Propagated AA flags through Ganesh's clip stack (in preparation for GL AA ↵Gravatar robertphillips@google.com2012-04-16
| | | | | | | | | | clipping) http://codereview.appspot.com/6038051/ git-svn-id: http://skia.googlecode.com/svn/trunk@3685 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix four memory leaks uncovered by valgrinding gm tests.Gravatar vandebo@chromium.org2012-03-14
| | | | | | | | | | | | | All are triggered by PDF code. Two are missing unref's on SkData. One is a missing unref on a SkAdvancedTypefaceMetrics. The last is missing destruction of SkClipStack internal state. BUG=526 Review URL: https://codereview.appspot.com/5824049 git-svn-id: http://skia.googlecode.com/svn/trunk@3386 2bbb7eff-a529-9590-31e7-b0007b416f81
* use SkRasterClip inside canvas (check-point for soft clipping)Gravatar reed@google.com2011-10-12
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2462 2bbb7eff-a529-9590-31e7-b0007b416f81
* Automatic update of all copyright notices to reflect new license terms.Gravatar epoger@google.com2011-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have manually examined all of these diffs and restored a few files that seem to require manual adjustment. The following files still need to be modified manually, in a separate CL: android_sample/SampleApp/AndroidManifest.xml android_sample/SampleApp/res/layout/layout.xml android_sample/SampleApp/res/menu/sample.xml android_sample/SampleApp/res/values/strings.xml android_sample/SampleApp/src/com/skia/sampleapp/SampleApp.java android_sample/SampleApp/src/com/skia/sampleapp/SampleView.java experimental/CiCarbonSampleMain.c experimental/CocoaDebugger/main.m experimental/FileReaderApp/main.m experimental/SimpleCocoaApp/main.m experimental/iOSSampleApp/Shared/SkAlertPrompt.h experimental/iOSSampleApp/Shared/SkAlertPrompt.m experimental/iOSSampleApp/SkiOSSampleApp-Base.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Debug.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Release.xcconfig gpu/src/android/GrGLDefaultInterface_android.cpp gyp/common.gypi gyp_skia include/ports/SkHarfBuzzFont.h include/views/SkOSWindow_wxwidgets.h make.bat make.py src/opts/memset.arm.S src/opts/memset16_neon.S src/opts/memset32_neon.S src/opts/opts_check_arm.cpp src/ports/SkDebug_brew.cpp src/ports/SkMemory_brew.cpp src/ports/SkOSFile_brew.cpp src/ports/SkXMLParser_empty.cpp src/utils/ios/SkImageDecoder_iOS.mm src/utils/ios/SkOSFile_iOS.mm src/utils/ios/SkStream_NSData.mm tests/FillPathTest.cpp Review URL: http://codereview.appspot.com/4816058 git-svn-id: http://skia.googlecode.com/svn/trunk@1982 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix a batch of coverity defects, uninitialized class fields.Gravatar vandebo@chromium.org2011-06-21
| | | | | | | | | In SkClipStack::B2FIter::Clip, SkWriter32, SkClipStack::Rec, SkDeque::F2BIter, SkPDFShader::State CID 15427,15433,15533,15532,16274,16740 Review URL: http://codereview.appspot.com/4630055 git-svn-id: http://skia.googlecode.com/svn/trunk@1669 2bbb7eff-a529-9590-31e7-b0007b416f81
* [PDF] Improve the SkClipStack skipping prefix code.Gravatar vandebo@chromium.org2011-05-25
| | | | | | | | Because of intersecting done in SkClipStack, we may have to do more work in the last entry of the prefix. Review URL: http://codereview.appspot.com/4530066 git-svn-id: http://skia.googlecode.com/svn/trunk@1418 2bbb7eff-a529-9590-31e7-b0007b416f81
* [PDF] Refactor content stream creation in SkPDFDevice to support more xfermodes.Gravatar vandebo@chromium.org2011-05-09
| | | | | | | | | | | Instead of writing all drawing and state updates into the final content stream immediately, this change creates a new ContentEntry each time the transform, clip, or paint changes. Drawing is done into a stream in the ContentEntry. When the consumer asks for the content, we combine all the ContentEntries with appropriate updates to the state (clip, transform, paint) in between. This allows us to modify the clip even after a drawing has completed. It also lets us remove ContentEntries with no drawing. Further optimization can be done to better use the stack features of PDF, for now we follow the previous model of having a single clip followed by a single transform on the graphic state stack. Push rectangle logic into SkPDFUtil::AppendRectangle. Change private functions to adhere to coding standards. Review URL: http://codereview.appspot.com/4459041 git-svn-id: http://skia.googlecode.com/svn/trunk@1269 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add comparison and assignment to SkClipStack (and fix an optimization bug).Gravatar vandebo@chromium.org2011-05-03
| | | | | | Review URL: http://codereview.appspot.com/4423085 git-svn-id: http://skia.googlecode.com/svn/trunk@1230 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add code needed to build skia as a windows dll within the chromium project.Gravatar ctguil@chromium.org2011-03-15
| | | | | | | | | - Export/import skia APIs if SKIA_DLL is defined. - This change has no effect on skia. Review URL: http://codereview.appspot.com/4282042 git-svn-id: http://skia.googlecode.com/svn/trunk@944 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
* Fix warnings about struct being forward declared as a classGravatar bsalomon@google.com2011-02-22
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@833 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