aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFShader.cpp
Commit message (Collapse)AuthorAge
* Fix thread unsafe mutex initialization.Gravatar bungeman2014-07-25
| | | | | | | | | BUG=skia:2779 R=robertphillips@google.com, mtklein@google.com, reed@android.com, bsalomon@google.com Author: bungeman@google.com Review URL: https://codereview.chromium.org/419113002
* Use SkMutex::assertHeld in SkPDFFont and SkPDFShader.Gravatar halcanary2014-06-20
| | | | | | | | R=mtklein@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/348113002
* deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. ↵Gravatar reed@google.com2013-12-17
| | | | | | | | | | | #define SK_SUPPORT_DEPRECATED_SCALARROUND for legacy clients BUG= R=robertphillips@google.com Review URL: https://codereview.chromium.org/111353003 git-svn-id: http://skia.googlecode.com/svn/trunk@12719 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix compilation with SK_ENABLE_INST_COUNT=1Gravatar commit-bot@chromium.org2013-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add INHERITED declarations to class declarations that prevent compilation with the flag. Remove SK_DEFINE_INST_COUNT from all class implementations. Instead, use function-local static variables in the reference count helper classes to create the global instances to store the needed info. The accessor functions are defined inline in the helper classes, so definitions are not needed. The initialization point of the variables should be as well defined as previously. Remove SK_DECLARE_INST_COUNT_TEMPLATE and use SK_DECLARE_INST_COUNT instead. This avoids possible future compilation errors further. For SK_ENABLE_INST_COUNT=0 compilation, add an empty static member function to all classes that use SK_DECLARE_INST_COUNT and SK_DECLARE_INST_COUNT_ROOT macros. The function ensures that classes contain public INHERITED typedef. This member function seems to be compiled away. This shouĺd ensure that part of the compilation errors are caught earlier. Also adds DSK_DECLARE_INST_COUNT to few SkPDFDict subclasses. R=robertphillips@google.com, richardlin@chromium.org, bsalomon@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/98703002 git-svn-id: http://skia.googlecode.com/svn/trunk@12501 2bbb7eff-a529-9590-31e7-b0007b416f81
* PDF: support perspective in simple shaders. (this version does not work well ↵Gravatar edisonn@google.com2013-10-24
| | | | | | | | | | with tilling) R=vandebo@chromium.org Review URL: https://codereview.chromium.org/26389006 git-svn-id: http://skia.googlecode.com/svn/trunk@11937 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "PDF: support perspective in simple shaders. (this version does not ↵Gravatar vandebo@chromium.org2013-10-18
| | | | | | | | | | | | work well with tilling)" Accidentally committed the wrong git branch. This reverts commit 76839c65670df8a863041a82a4b61502e78af043. Review URL: https://codereview.chromium.org/29743002 git-svn-id: http://skia.googlecode.com/svn/trunk@11865 2bbb7eff-a529-9590-31e7-b0007b416f81
* PDF: support perspective in simple shaders. (this version does not work well ↵Gravatar vandebo@chromium.org2013-10-18
| | | | | | | | with tilling) Review URL: https://codereview.chromium.org/26389006 git-svn-id: http://skia.googlecode.com/svn/trunk@11864 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SkPDFDeviceFlatenner which extends SkPDFDevice to add support to flatten ↵Gravatar commit-bot@chromium.org2013-10-14
| | | | | | | | | | | | | | | the path and the text when we have perspective. prepare to deprecate SkPDFDevice constructor, and route gm and render_pdfs to use SkDocument::Create pdf interface instead. - controlled by a flag add comments where we are supposed to flatten other features (paint, shaders, ... ) R=reed@google.com, bungeman@google.com, scroggo@google.com, vandebo@chromium.org, bsalomon@google.com Author: edisonn@google.com Review URL: https://codereview.chromium.org/24811002 git-svn-id: http://skia.googlecode.com/svn/trunk@11751 2bbb7eff-a529-9590-31e7-b0007b416f81
* pdf: ifgnore shader colors applied for 0 range.Gravatar edisonn@google.com2013-09-17
| | | | | | | | R=vandebo@chromium.org Review URL: https://codereview.chromium.org/23654044 git-svn-id: http://skia.googlecode.com/svn/trunk@11322 2bbb7eff-a529-9590-31e7-b0007b416f81
* Restyle SkPDFImageShader and support tiling bitmaps outside clip boundsGravatar commit-bot@chromium.org2013-08-21
| | | | | | | | | | | BUG=chromium:99458 R=edisonn@google.com, vandebo@chromium.org Author: richardlin@chromium.org Review URL: https://chromiumcodereview.appspot.com/22884013 git-svn-id: http://skia.googlecode.com/svn/trunk@10870 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implemented transparent gradientsGravatar commit-bot@chromium.org2013-07-23
| | | | | | | | | | R=vandebo@chromium.org, edisonn@google.com Author: richardlin@chromium.org Review URL: https://chromiumcodereview.appspot.com/18585002 git-svn-id: http://skia.googlecode.com/svn/trunk@10297 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix Clang build on SkPDFResourceDict (CL 18977002)Gravatar commit-bot@chromium.org2013-07-23
| | | | | | | | | | R=edisonn@google.com, vandebo@chromium.org Author: richardlin@chromium.org Review URL: https://chromiumcodereview.appspot.com/19954011 git-svn-id: http://skia.googlecode.com/svn/trunk@10295 2bbb7eff-a529-9590-31e7-b0007b416f81
* If we fail to contruct the Pdf Image Shader, mark the object as busted, and ↵Gravatar edisonn@google.com2013-07-23
| | | | | | | | | | dn't try to remove it from shaders list. Also, when we delete invalid shaders, remove the lock, otherwise we freeze (see CanonicalShadersMutex usage). R=vandebo@chromium.org Review URL: https://codereview.chromium.org/19509005 git-svn-id: http://skia.googlecode.com/svn/trunk@10290 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Adds SkPDFResourceDict class, refactor existing code to use it."Gravatar vandebo@chromium.org2013-07-22
| | | | | | | | This reverts commit r10245 Review URL: https://codereview.chromium.org/19523007 git-svn-id: http://skia.googlecode.com/svn/trunk@10247 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adds SkPDFResourceDict class, refactor existing code to use it.Gravatar commit-bot@chromium.org2013-07-22
| | | | | | | | | | | | Committed: http://code.google.com/p/skia/source/detail?r=10202 R=vandebo@chromium.org, edisonn@google.com Author: richardlin@chromium.org Review URL: https://chromiumcodereview.appspot.com/18977002 git-svn-id: http://skia.googlecode.com/svn/trunk@10245 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Adds SkPDFResourceDict class to manage resource dicts. Refactors ↵Gravatar vandebo@chromium.org2013-07-19
| | | | | | | | | | existing code to use this class." This reverts commit r10202 Review URL: https://codereview.chromium.org/19790007 git-svn-id: http://skia.googlecode.com/svn/trunk@10205 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adds SkPDFResourceDict class to manage resource dicts. Refactors existing ↵Gravatar commit-bot@chromium.org2013-07-19
| | | | | | | | | | | | | code to use this class. BUG= R=vandebo@chromium.org, edisonn@google.com Author: richardlin@chromium.org Review URL: https://chromiumcodereview.appspot.com/18977002 git-svn-id: http://skia.googlecode.com/svn/trunk@10202 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fixed a bug with linear gradient PDF matrices and added test casesGravatar commit-bot@chromium.org2013-06-12
| | | | | | | | | | R=vandebo@chromium.org, reed@google.com Author: richardlin@chromium.org Review URL: https://chromiumcodereview.appspot.com/16094020 git-svn-id: http://skia.googlecode.com/svn/trunk@9553 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix build error when building Android in Release mode with -O2.Gravatar djsollen@google.com2013-04-03
| | | | | | | | | | | This fixes the folowing error... ../../../src/pdf/SkPDFShader.cpp: In function 'void gradientFunctionCode(const SkShader::GradientInfo&, SkString*)': ../../../src/pdf/SkPDFShader.cpp:69:19: error: array subscript is above array bounds [-Werror=array-bounds] Review URL: https://codereview.chromium.org/13471011 git-svn-id: http://skia.googlecode.com/svn/trunk@8506 2bbb7eff-a529-9590-31e7-b0007b416f81
* resubmit https://code.google.com/p/skia/source/detail?r=7883 (in the meantime weGravatar edisonn@google.com2013-04-02
| | | | | | | added capability to collect minidump and callstack if buildbot fails with heap coruption in windows, and a NPE bug was fixed in SkPDFDocument, when document was destroyed without ever beeing used and a field was NULL + a few minor conflicts have been resolved) git-svn-id: http://skia.googlecode.com/svn/trunk@8487 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reverting r8233 (Use SkSet in PDF)Gravatar robertphillips@google.com2013-03-20
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8255 2bbb7eff-a529-9590-31e7-b0007b416f81
* resubmit https://code.google.com/p/skia/source/detail?r=7883 (in the ↵Gravatar edisonn@google.com2013-03-19
| | | | | | | | meantime we added capability to collect minidump and callstack if buildbot fails with heap coruption in windows. a few minor conflicts have been resolved) Review URL: https://codereview.chromium.org/12840004 git-svn-id: http://skia.googlecode.com/svn/trunk@8233 2bbb7eff-a529-9590-31e7-b0007b416f81
* revert r7892Gravatar edisonn@google.com2013-02-28
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7896 2bbb7eff-a529-9590-31e7-b0007b416f81
* resubmit after fixing assert issue: https://codereview.appspot.com/6744050Gravatar edisonn@google.com2013-02-27
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7892 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert r7883Gravatar edisonn@google.com2013-02-27
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7884 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use SkSet to fix issue when pdf generates an exp number of resources.Gravatar edisonn@google.com2013-02-27
| | | | | | | | | | | | | | | The problem fixed - http://code.google.com/p/skia/issues/detail?id=940 - is that getResources will recursively obtain all child resource recursively without checking for duplicates. If we have lots of duplicates, then we try to build a very large vector (exponential with the number of nodes usually) and sooner or later we end up using too much memory and crash. A possible solution could have been to make sure resources do not have duplicates, but that requirement is impractical, and it this leaves the solution fragile, if there is any issue in the tree, we crash. When we emit the pdf, the large number of duplicates is not an issue, because SkPDFCatalog::addObject will deal with duplicates. I have run the gm with --config pdf, and the images are 100% same bits, while the pdfs have the same size but some very small changes, the order of some objects. Review URL: https://codereview.appspot.com/6744050 git-svn-id: http://skia.googlecode.com/svn/trunk@7883 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove SkRefPtrGravatar vandebo@chromium.org2013-01-04
| | | | | | | | | (resubmit of https://codereview.appspot.com/7030059/) TBR=junov@google.com Review URL: https://codereview.appspot.com/7030065 git-svn-id: http://skia.googlecode.com/svn/trunk@7030 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Remove SkRefPtr" - r7021Gravatar vandebo@chromium.org2013-01-04
| | | | | | | | samplecode/ still needs to be updated. Review URL: https://codereview.appspot.com/7032048 git-svn-id: http://skia.googlecode.com/svn/trunk@7022 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove SkRefPtrGravatar vandebo@chromium.org2013-01-04
| | | | | | Review URL: https://codereview.appspot.com/7030059 git-svn-id: http://skia.googlecode.com/svn/trunk@7021 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make SkShader store localM directly rather than as a separate alloc.Gravatar bsalomon@google.com2012-10-31
| | | | | | | May cause very slight GM changes in gpu two pt radial/conical radients. Review URL: https://codereview.appspot.com/6821056 git-svn-id: http://skia.googlecode.com/svn/trunk@6221 2bbb7eff-a529-9590-31e7-b0007b416f81
* [PDF] Fix gradient generation code (remove extra 'dup' in some cases)Gravatar vandebo@chromium.org2012-10-22
| | | | | | | | Fixes http://crbug.com/157006 Review URL: https://codereview.appspot.com/6733061 git-svn-id: http://skia.googlecode.com/svn/trunk@6035 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 II of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6474054 git-svn-id: http://skia.googlecode.com/svn/trunk@5263 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use asNewCustomStage instead of asABitmap in SkGpuDevice, also removed ↵Gravatar rileya@google.com2012-07-25
| | | | | | | | | now-unecessary twoPointRadialParams parameter from asABitmap. In SkGpuDevice we still fall back on using asABitmap for effects that don't have asNewCustomStage implemented, but it still simplifies things a fair amount. Review URL: https://codereview.appspot.com/6430060 git-svn-id: http://skia.googlecode.com/svn/trunk@4755 2bbb7eff-a529-9590-31e7-b0007b416f81
* Replace all instances of 'clear' with 'pop's in conical gradient pdf impl, ↵Gravatar rileya@google.com2012-07-10
| | | | | | looks like the pdf spec doesn't support Postscript's 'clear' stack operator. Should fix some warnings on mac buildbots. git-svn-id: http://skia.googlecode.com/svn/trunk@4521 2bbb7eff-a529-9590-31e7-b0007b416f81
* Added pdf implementation of conical gradient.Gravatar rileya@google.com2012-07-10
| | | | | | | Also fixed an erroneous comment in the gpu implementation. Review URL: https://codereview.appspot.com/6351076 git-svn-id: http://skia.googlecode.com/svn/trunk@4520 2bbb7eff-a529-9590-31e7-b0007b416f81
* [PDF] Fix PDF code to not crash on SkComposeShader.Gravatar vandebo@chromium.org2012-06-28
| | | | | | Review URL: https://codereview.appspot.com/6354053 git-svn-id: http://skia.googlecode.com/svn/trunk@4400 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix missing switch-statement handler (for conical gradient)Gravatar reed@google.com2012-06-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4229 2bbb7eff-a529-9590-31e7-b0007b416f81
* extend asAGradient for Conical type (to be implemented by PDF and XPS)Gravatar reed@google.com2012-06-07
| | | | | | Review URL: https://codereview.appspot.com/6308051 git-svn-id: http://skia.googlecode.com/svn/trunk@4207 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fixed minor c++ issues found by cppcheckGravatar robertphillips@google.com2012-04-27
| | | | | | | | http://codereview.appspot.com/6127049/ git-svn-id: http://skia.googlecode.com/svn/trunk@3771 2bbb7eff-a529-9590-31e7-b0007b416f81
* [PDF] Handle failures of matrix inversionGravatar vandebo@chromium.org2012-04-17
| | | | | | | | | Previously reviewed in https://codereview.appspot.com/6033047. Rolled back because of unrelated fixed-point bugs. Review URL: https://codereview.appspot.com/6052051 git-svn-id: http://skia.googlecode.com/svn/trunk@3715 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix some fixed-point bugs.Gravatar vandebo@chromium.org2012-04-17
| | | | | | Review URL: https://codereview.appspot.com/6047046 git-svn-id: http://skia.googlecode.com/svn/trunk@3714 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "[PDF] Handle failures of matrix inversion" while I investigate fixed ↵Gravatar vandebo@chromium.org2012-04-17
| | | | | | | | | | point failures. This reverts commit r3711 Review URL: https://codereview.appspot.com/6050049 git-svn-id: http://skia.googlecode.com/svn/trunk@3712 2bbb7eff-a529-9590-31e7-b0007b416f81
* [PDF] Handle failures of matrix inversion.Gravatar vandebo@chromium.org2012-04-17
| | | | | | Review URL: https://codereview.appspot.com/6033047 git-svn-id: http://skia.googlecode.com/svn/trunk@3711 2bbb7eff-a529-9590-31e7-b0007b416f81
* [PDF] If matrix inversion fails, use the identity matrix.Gravatar vandebo@chromium.org2012-04-13
| | | | | | | | BUG=chrome:123078 Review URL: https://codereview.appspot.com/6007044 git-svn-id: http://skia.googlecode.com/svn/trunk@3676 2bbb7eff-a529-9590-31e7-b0007b416f81
* [PDF] Fix memory hungry inefficiency in pdf resource tracking.Gravatar vandebo@chromium.org2012-03-09
| | | | | | | | | | | | | When moving the content of a device into a PDF object like SkPDFFormXObject or SkPDFShader does, we only need the top level resources in the new object's resource list, not the recursive set of objects. Otherwise, when you put a form on a form on form, etc, references to the objects multiply. This fixed http://crbug.com/117321 Review URL: https://codereview.appspot.com/5796048 git-svn-id: http://skia.googlecode.com/svn/trunk@3360 2bbb7eff-a529-9590-31e7-b0007b416f81
* [PDF] Fix some fixed/float-point mismatches for image shaders.Gravatar vandebo@chromium.org2012-03-09
| | | | | | | | BUG=520 Review URL: https://codereview.appspot.com/5787061 git-svn-id: http://skia.googlecode.com/svn/trunk@3356 2bbb7eff-a529-9590-31e7-b0007b416f81
* posix: Avoid static initializers in static/global mutexesGravatar digit@google.com2012-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes static initializers related to static and global mutexes from the final library's machine code when building on a pthread-capable system. We use PTHREAD_MUTEX_INITIALIZER to perform POD-style initialization. You need a line like the following to declare a global mutex with it: SkBaseMutex gMutex = { PTHREAD_MUTEX_INITIALIZER }; We introduce the SK_DECLARE_STATIC_MUTEX and SK_DECLARE_GLOBAL_MUTEX macros to be able to declare static/global mutexes in the source tree uniformly. SkMutex is now defined as a sub-class of SkBaseMutex, with standard construction/destruction semantics. This is useful if the mutex object is a member of another C++ class, or allocated dynamically. We also modify a few places to refer to SkBaseMutex instead of a SkMutex, where it makes sense. Generally speaking, client code should hold and use pointers to SkBaseMutex whenever they can now. We defined a new built-time macro named SK_USE_POSIX_THREADS to indicate that we're using a pthread-based SkThread.h interface. The macro will also be used in future patches to implement other helper thread synchronization classes. Finally, we inline the acquire() and release() functions in the case of Posix to improve performance a bit. Running: 'bench -repeat 10 -match mutex' on an Android device or a 2.4GHz Xeon Linux desktop shows the following improvements: Before After Galaxy Nexus 1.64 1.45 Nexus S 1.47 1.16 Xoom 1.86 1.66 Xeon 0.36 0.31 This removes 5 static mutex initializers from the library Review URL: https://codereview.appspot.com/5501066 git-svn-id: http://skia.googlecode.com/svn/trunk@3091 2bbb7eff-a529-9590-31e7-b0007b416f81
* [PDF] Fix some scalar/int assumptions.Gravatar vandebo@chromium.org2012-01-05
| | | | | | Review URL: http://codereview.appspot.com/5516043 git-svn-id: http://skia.googlecode.com/svn/trunk@2975 2bbb7eff-a529-9590-31e7-b0007b416f81
* Coverity: Add a default case in SkPDFShader. CID=101159Gravatar vandebo@chromium.org2011-12-21
| | | | | | | | Code from thestig@chromium.org original CL: http://codereview.appspot.com/5498052/ Review URL: http://codereview.appspot.com/5502052 git-svn-id: http://skia.googlecode.com/svn/trunk@2913 2bbb7eff-a529-9590-31e7-b0007b416f81
* Address lint issues in pdf directories.Gravatar ctguil@chromium.org2011-08-15
| | | | | | Review URL: http://codereview.appspot.com/4887042 git-svn-id: http://skia.googlecode.com/svn/trunk@2117 2bbb7eff-a529-9590-31e7-b0007b416f81