aboutsummaryrefslogtreecommitdiffhomepage
path: root/gyp
Commit message (Collapse)AuthorAge
* Implement a benchmark for GrResourceCacheGravatar commit-bot@chromium.org2013-11-21
| | | | | | | | | | | | | | | | | | | | | | | Adds "grresourcecache_add" and "grresourcecache_find" bench tests to test GrResourceCache::add and GrResourceCache::find. The tests work only with GPU backends, since GrResourceCache needs an GrGpu. Modifies bench tests to override SkBenchmark::isSuitableFor(Backend) function that specifies what kind of backend the test is inteded for. This replaces the previous "fIsRendering" flag that would indicate test that did no rendering. Adds SkCanvas::getGrContext() call to get the GrContext that the canvas ends up drawing to. The member function solves a common use-case that is also used in the benchmark added here. R=mtklein@google.com, bsalomon@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/73643005 git-svn-id: http://skia.googlecode.com/svn/trunk@12334 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move PdfTokenLooper into its own file.Gravatar scroggo@google.com2013-11-20
| | | | | | | | Otherwise, leave the class unchanged. Review URL: https://codereview.chromium.org/79773002 git-svn-id: http://skia.googlecode.com/svn/trunk@12333 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move SkPdfContext into its own files.Gravatar scroggo@google.com2013-11-20
| | | | | | | | Otherwise, the class is unchanged. Review URL: https://codereview.chromium.org/77763007 git-svn-id: http://skia.googlecode.com/svn/trunk@12330 2bbb7eff-a529-9590-31e7-b0007b416f81
* Changes to SkTDStackNester.Gravatar scroggo@google.com2013-11-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SkTDStackNester is a class used by PdfViewer to assist in saving and restoring the PDF state. Clean up and test this class. Add some documentation. Add FIXME's where I have questions to resolve. Fix a bug where fNestingLevel was not initialized. Remove a commented out line of code copied over from SkTDStack. Rename SkTDStackNester::nests() to nestingLevel() and make it const. Remove unnecessary predeclaration and friend declaration. Remove index() (both const and non-const versions). They were unused, return something that may not be expected (index from the top, rather than from the bottom), and don't work to get any elements in earlier Recs once the first one is full. Report a warning if the nesting level goes above the maximum level, or if we attempt to bring it below zero. Prevent fNestingLevel from dropping below zero. Add kUnusedObject_SkPdfIssue, and use it where appropriate. Depends on https://codereview.chromium.org/64093009/ R=mtklein@google.com Review URL: https://codereview.chromium.org/68843006 git-svn-id: http://skia.googlecode.com/svn/trunk@12328 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move SkTDStackNester into its own private file.Gravatar scroggo@google.com2013-11-20
| | | | | | | | | | | | Also remove depth(), which is unused. Otherwise the class is unchanged. R=mtklein@google.com Review URL: https://codereview.chromium.org/64093009 git-svn-id: http://skia.googlecode.com/svn/trunk@12324 2bbb7eff-a529-9590-31e7-b0007b416f81
* More common_conditions simplifications.Gravatar mtklein@google.com2013-11-20
| | | | | | | | | BUG= R=bungeman@google.com, djsollen@google.com Review URL: https://codereview.chromium.org/78653002 git-svn-id: http://skia.googlecode.com/svn/trunk@12322 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add extra warnings to match what Android uses.Gravatar mtklein@google.com2013-11-20
| | | | | | | | | | R=mtklein@google.com Committed: https://code.google.com/p/skia/source/detail?r=12310 Review URL: https://codereview.chromium.org/74193005 git-svn-id: http://skia.googlecode.com/svn/trunk@12314 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Add extra warnings to match what Android uses."Gravatar scroggo@google.com2013-11-20
| | | | | | | | This reverts commit d234662df1ffeb1bf45b2ade16c4acfb94f89450. This change broke the build. Will resubmit after fixing warnings. git-svn-id: http://skia.googlecode.com/svn/trunk@12311 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add extra warnings to match what Android uses.Gravatar djsollen@google.com2013-11-20
| | | | | | | | R=mtklein@google.com Review URL: https://codereview.chromium.org/74193005 git-svn-id: http://skia.googlecode.com/svn/trunk@12310 2bbb7eff-a529-9590-31e7-b0007b416f81
* Pdfviewer refactoring.Gravatar scroggo@google.com2013-11-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mostly superficial changes, to help me make sure I understand the code while making modifications. SkPdfRenderer: First class I'm modifying. Move it into include/ and src/ directories. Inherit from SkNoncopyable. Replace load() with factory function which returns NULL if the load fails. Remove unload() and loaded(), which no longer make sense, since the factory will return NULL on a failure to load, and unload() happens on destruction. Use a const char* for loading a PDF, following the convention of SkStream::NewFromFile. Remove unnecessary call to sqrt in SkPDFNativeRenderToBitmap. Also in SkPDFNativeRenderToBitmap, use an appropriate SkScalar macro to convert to an integer. Use this-> when calling member functions. pdf_viewer_main.cpp: Call the new interface for SkPdfRenderer. gyp files: Refer to the new location of SkPdfRenderer. R=edisonn@google.com Review URL: https://codereview.chromium.org/59493011 git-svn-id: http://skia.googlecode.com/svn/trunk@12296 2bbb7eff-a529-9590-31e7-b0007b416f81
* Include pdfviewer in everything.Gravatar scroggo@google.com2013-11-14
| | | | | | | | | | | | | | | | | This simplifies the process for building pdfviewer. Now it can be built using ./gyp_skia make pdfviewer (ninja can also be used). R=edisonn@google.com Review URL: https://codereview.chromium.org/70353003 git-svn-id: http://skia.googlecode.com/svn/trunk@12288 2bbb7eff-a529-9590-31e7-b0007b416f81
* move SkImageInfo into its own headerGravatar reed@google.com2013-11-13
| | | | | | | | | BUG= R=djsollen@google.com Review URL: https://codereview.chromium.org/71813002 git-svn-id: http://skia.googlecode.com/svn/trunk@12273 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix multithread related crashes in skpdiffGravatar djsollen@google.com2013-11-12
| | | | | | | | | BUG=skia:1798 R=mtklein@google.com, scroggo@google.com Review URL: https://codereview.chromium.org/60833002 git-svn-id: http://skia.googlecode.com/svn/trunk@12252 2bbb7eff-a529-9590-31e7-b0007b416f81
* pdfviewer: compile pdfviewer in gm, only if the flag is set (currently we ↵Gravatar commit-bot@chromium.org2013-11-12
| | | | | | | | | | | | compile pdfviewer, even if it is not used) R=scroggo@google.com, jvanverth@google.com Author: edisonn@google.com Review URL: https://codereview.chromium.org/68533003 git-svn-id: http://skia.googlecode.com/svn/trunk@12249 2bbb7eff-a529-9590-31e7-b0007b416f81
* Hook in rough distance field support for fontsGravatar jvanverth@google.com2013-11-11
| | | | | | | | R=bsalomon@google.com Review URL: https://codereview.chromium.org/41213003 git-svn-id: http://skia.googlecode.com/svn/trunk@12229 2bbb7eff-a529-9590-31e7-b0007b416f81
* Android FontHost cannot use FontMgr yet.Gravatar bungeman@google.com2013-11-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12221 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement a NEON version of morphology. This is good for ~2.2X speedup on ↵Gravatar senorblanco@chromium.org2013-11-11
| | | | | | | | | | Tegra3. R=mtklein@google.com, mtklein, reed@google.com Review URL: https://codereview.chromium.org/68123003 git-svn-id: http://skia.googlecode.com/svn/trunk@12219 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove SK_FONTHOST_USES_FONTMGR.Gravatar bungeman@google.com2013-11-11
| | | | | | Review URL: https://codereview.chromium.org/66783003 git-svn-id: http://skia.googlecode.com/svn/trunk@12217 2bbb7eff-a529-9590-31e7-b0007b416f81
* Initial draft code to run pdfviewer withg gmsGravatar commit-bot@chromium.org2013-11-11
| | | | | | | | | | | | draft cl to run pdfviewer with gms modified: gm/gmmain.cpp modified: gyp/gm.gyp modified: src/utils/SkPDFRasterizer.cpp modified: src/utils/SkPDFRasterizer.h R=scroggo@google.com, borenet@google.com Author: edisonn@google.com Review URL: https://codereview.chromium.org/26269002 git-svn-id: http://skia.googlecode.com/svn/trunk@12214 2bbb7eff-a529-9590-31e7-b0007b416f81
* add GM case nonclosedpaths. The 2 bugs below showed some non-closed paths ↵Gravatar commit-bot@chromium.org2013-11-09
| | | | | | | | | | | | | | which are easy to get wrong rendering results. So add a GM case for this kind paths to avoid potential bugs to be introduced. BUG=skia:1782 BUG=skia:1811 R=bsalomon@google.com, caryclark@google.com, reed@google.com, robertphillips@google.com Author: yunchao.he@intel.com Review URL: https://codereview.chromium.org/64173009 git-svn-id: http://skia.googlecode.com/svn/trunk@12206 2bbb7eff-a529-9590-31e7-b0007b416f81
* SSE2 implementation of RGBA box blurs. This yields ~2X perf improvement on ↵Gravatar senorblanco@chromium.org2013-11-08
| | | | | | | | | | Xeon ES-2690. R=mtklein@google.com Review URL: https://codereview.chromium.org/61643011 git-svn-id: http://skia.googlecode.com/svn/trunk@12204 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix stale assert in GrDrawTarget::printGravatar commit-bot@chromium.org2013-11-08
| | | | | | | | | | | | Fix stale assert in GrDrawTarget::print. R=bsalomon@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/66333002 git-svn-id: http://skia.googlecode.com/svn/trunk@12201 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add GM to verify removal of 32767 limit in ↵Gravatar robertphillips@google.com2013-11-07
| | | | | | | | | | SkBlurMaskFilter::filterRectsToNine is okay https://codereview.chromium.org/60513013/ git-svn-id: http://skia.googlecode.com/svn/trunk@12181 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Revert "speed up A8 by creating a new entry-point in SkDraw that ↵Gravatar reed@google.com2013-11-07
| | | | | | | | | | | | blits the path's coverage directly into an A8 target, regardless of the previous pixel values."" This reverts commit 3c77887b3eb2d32ab668ab4e5f2f9e79103956e8. BUG= Review URL: https://codereview.chromium.org/50673005 git-svn-id: http://skia.googlecode.com/svn/trunk@12167 2bbb7eff-a529-9590-31e7-b0007b416f81
* New SkRTConf macro SK_CONF_TRY_SET: no complaint on missing configurationGravatar halcanary@google.com2013-11-06
| | | | | | | | | | | | | | | | | | | | | | | | | | SK_CONF_TRY_SET() is like SK_CONF_SET(), but doesn't complain if confname can't be found. This is useful if the SK_CONF_DECLARE is inside a source file whose linkage is dependent on the system. Internally to the SkRTConf system, SkRTConfRegistry::set() was given an additional parameter controling wanrings. A new RuntimeConfig unit test was introduced. It should run silently. In the future, it should be expanded to cover all of the SkRTConf functionality. (For example, the images.jpeg.suppressDecoderWarnings variable is defined and used only in SkImageDecoder_libjpeg.cpp, but on MacOS, we use Core Graphics via SkImageDecoder_CG.cpp - SkImageDecoder_libjpeg is never linked in. The same is true of the Windows Imaging Component on Windows.) BUG= R=reed@google.com Review URL: https://codereview.chromium.org/54503007 git-svn-id: http://skia.googlecode.com/svn/trunk@12155 2bbb7eff-a529-9590-31e7-b0007b416f81
* Break up SkLazyPixelRef functionally into class hierarchy.Gravatar commit-bot@chromium.org2013-11-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reason for this CL is to allow greater decoder flexibility. Chrome currently uses its own decoding functions. These allow for greater flexibility in dealing with images with multiple frames or partial data. The DecodeProc function was not flexible enough to handle these. Instead of asking the decoder to squeeze everything into the DecodeProc, we now ask the downstream library to inherit from SkCachingPixelRef. If WebKit's LazyDecodingPixelRef is re-tooled to inherit from SkCachingPixelRef, then it can make use of Skia's caching ability while still allowing it to deal with multiple frames, scaling, subsetting, and partial data. - The abstract SkCachingPixelRef class handles caching the decoded data in a SkScaledImageCache. This class relies on the virtual functions onDecodeInfo() and onDecode() to do the actual decoding of data. - The SkLazyCachingPixelRef class is derived from SkCachingPixelRef. It provides an implementation of onDecodeInfo() and onDecode() in terms of calls to a SkBitmapFactory::DecodeProc function. It also provides an Install() static method which installs a new SkLazyCachingPixelRef into a SkBitmap. SkLazyCachingPixelRef exists for two reasons: to test SkCachingPixelRef within Skia and as an example for downstream developers to make their own classes that inherit from SkCachingPixelRef. - The CachedDecodingPixelRefTest was updated to test the SkLazyCachingPixelRef class and indirectly the SkCachingPixelRef class. BUG= R=reed@google.com, scroggo@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/54203006 git-svn-id: http://skia.googlecode.com/svn/trunk@12149 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add gms and benchmarks for drawing blurry round rects.Gravatar scroggo@google.com2013-11-05
| | | | | | | | | | | | | | | Further changes (https://codereview.chromium.org/48623006) will change the speed at which the bench draws and the drawing of the gm (the gm change is small). One of these round rects causes slow drawing in a webpage that we have observed. BUG=https://b.corp.google.com/issue?id=11174385 Review URL: https://codereview.chromium.org/52793005 git-svn-id: http://skia.googlecode.com/svn/trunk@12133 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "speed up A8 by creating a new entry-point in SkDraw that blits the ↵Gravatar reed@google.com2013-11-04
| | | | | | | | | | | | | | | | path's coverage directly into an A8 target, regardless of the previous pixel values." This reverts commit d615e839b71f75df895de6850b774a9e1c28ad2a. Revert "must initialize SkDraw.fClip" This reverts commit 108e46d29b5f57927fc8b8c403bb52019d8cb16d. BUG= Review URL: https://codereview.chromium.org/57883006 git-svn-id: http://skia.googlecode.com/svn/trunk@12122 2bbb7eff-a529-9590-31e7-b0007b416f81
* speed up A8 by creating a new entry-point in SkDraw that blits the path's ↵Gravatar reed@google.com2013-11-04
| | | | | | | | | | coverage directly into an A8 target, regardless of the previous pixel values. R=bsalomon@google.com, mtklein@google.com Review URL: https://codereview.chromium.org/56453002 git-svn-id: http://skia.googlecode.com/svn/trunk@12118 2bbb7eff-a529-9590-31e7-b0007b416f81
* pathops work in progressGravatar caryclark@google.com2013-11-01
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/52653002 git-svn-id: http://skia.googlecode.com/svn/trunk@12089 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adding size parameter to read array functionsGravatar commit-bot@chromium.org2013-10-31
| | | | | | | | | | | | | | | | | | | In some cases, the allocated array into which the data will be read is using getArrayCount() to allocate itself, which should be safe, but some cases use fixed length arrays or compute the array size before reading, which could overflow if the stream is compromised. To prevent that from happening, I added a check that will verify that the number of bytes to read will not exceed the capacity of the input buffer argument passed to all the read...Array() functions. I chose to use the byte array for this initial version, so that "size" represents the same value across all read...Array() functions, but I could also use the element count, if it is preferred. Note : readPointArray and writePointArray are unused, so I could also remove them BUG= R=reed@google.com, mtklein@google.com, senorblanco@chromium.org Author: sugoi@chromium.org Review URL: https://codereview.chromium.org/37803002 git-svn-id: http://skia.googlecode.com/svn/trunk@12058 2bbb7eff-a529-9590-31e7-b0007b416f81
* Speculative Android build fix.Gravatar senorblanco@chromium.org2013-10-30
| | | | | | | | TBR=robertphillips Review URL: https://codereview.chromium.org/52693003 git-svn-id: http://skia.googlecode.com/svn/trunk@12041 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement SSE2-based implementations of the morphology filters (dilate & ↵Gravatar senorblanco@chromium.org2013-10-30
| | | | | | | | | | | | erode). This gives a 3-5X speedup over the naive implementation, and also mitigates a timing-based security attack in Chrome (https://code.google.com/p/chromium/issues/detail?id=251711). NOTE: this will require a corresponding GYP change on the Skia roll into Chrome: https://codereview.chromium.org/52453004/ R=mtklein@google.com, reed@google.com Review URL: https://codereview.chromium.org/52603004 git-svn-id: http://skia.googlecode.com/svn/trunk@12038 2bbb7eff-a529-9590-31e7-b0007b416f81
* Allow specifying the max texture count on the botsGravatar robertphillips@google.com2013-10-30
| | | | | | | | https://codereview.chromium.org/50413011/ git-svn-id: http://skia.googlecode.com/svn/trunk@12020 2bbb7eff-a529-9590-31e7-b0007b416f81
* Allow SkLazyPixelRef to use SkScaledImageCacheGravatar commit-bot@chromium.org2013-10-29
| | | | | | | | | | | | | | | | | | | | | | | | | | - SkScaledImageCache: - Add new FindAndLock/AddAndLock variants that work well with SkLazyPixelRefs (take width, height, generation_id). - Add static versions of these new variants. - SkLazyPixelRef: - If NULL passed in as SkImageCache* in the constructor, it will now default to using the static SkScaledImageCache methods to cache decoded images. - If (fImageCache==NULL), the default allocator can be changed with the setAllocator method. If (fImageCache!=NULL), the SkImageCache handles allocation. - CachedDecodingPixelRefTest to test the new functionality. BUG= R=scroggo@google.com, mtklein@google.com, reed@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/37343002 git-svn-id: http://skia.googlecode.com/svn/trunk@12006 2bbb7eff-a529-9590-31e7-b0007b416f81
* A fix for annoying clang error "unused-const-variabl" in third_party code.Gravatar commit-bot@chromium.org2013-10-28
| | | | | | | | | | | | | | | | | ../../third_party/externals/libwebp/src/enc/quant.c:105:23: error: unused variable 'kCoeffThresh' [-Werror,-Wunused-const-variable] static const uint16_t kCoeffThresh[16] = { ^ 1 error generated. BUG=None TEST=build with clang, ninja -C out/Debug most. R=bsalomon@google.com, epoger@google.com, thakis@chromium.org, mtklein@google.com Author: tfarina@chromium.org Review URL: https://codereview.chromium.org/47603012 git-svn-id: http://skia.googlecode.com/svn/trunk@11990 2bbb7eff-a529-9590-31e7-b0007b416f81
* DM: add --pipeGravatar commit-bot@chromium.org2013-10-28
| | | | | | | | | | | | | internal_links is failing across all three versions. One of the rects doesn't draw. BUG= R=epoger@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/47773002 git-svn-id: http://skia.googlecode.com/svn/trunk@11985 2bbb7eff-a529-9590-31e7-b0007b416f81
* Factor out skia_keep_frame_pointer. Handy with perf to get call stacks.Gravatar commit-bot@chromium.org2013-10-25
| | | | | | | | | | | | | Today it's set when we're running a sanitizer, but it's more generally useful. perf record -g (--call-graph) only works for me if we don't omit the frame pointer. BUG= R=bungeman@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/41923004 git-svn-id: http://skia.googlecode.com/svn/trunk@11966 2bbb7eff-a529-9590-31e7-b0007b416f81
* We want to give SkPixelRef a way to signal over to GrResourceCache that it's ↵Gravatar commit-bot@chromium.org2013-10-24
| | | | | | | | | | | | | | | | | | | | | become pointless to keep around textures based on that SkPixelRef when its pixels change, so that it can be a good citizen and free those textures. This adds an invalidation listener mechanism to SkPixelRef to let it send this message while still staying ignorant of who's listening. These messages are tricky to deliver. The SkPixelRefs they originates from and the GrResourceCaches they ultimately end up at may be on different threads; neither class is threadsafe; their object lifetimes are totally independent; it's a many-senders-to-many-receivers relation; and neither codebase should really know about the other. So I've added a per-message-type global message bus to broadcast messages to threadsafe inboxes. Anyone can post() a message, which will show up in all the inboxes of that type, read whenever the inbox's owner calls poll(). The implementation is _dumb_; it can be improved in several dimensions (inbox size limits, lock-free message delivery) if we find the need. I took some care to make sure not to send the invalidation message for any SkPixelRef that's sharing a generation ID with another SkPixelRef. BUG= R=bsalomon@google.com, scroggo@google.com, reed@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/26734003 git-svn-id: http://skia.googlecode.com/svn/trunk@11949 2bbb7eff-a529-9590-31e7-b0007b416f81
* [PDF] Add unpremultiply support and a GM (try5)Gravatar vandebo@chromium.org2013-10-24
| | | | | | | | | | | | This is a resubmit of https://codereview.chromium.org/22831039 which was reverted because it causes issues on Windows. BUG=chromium:175548 R=edisonn@google.com Review URL: https://codereview.chromium.org/37873003 git-svn-id: http://skia.googlecode.com/svn/trunk@11945 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "[PDF] Add unpremultiply support and a GM (try4)"Gravatar vandebo@chromium.org2013-10-23
| | | | | | | | | | This reverts commit r11928 gm seems to crash on windows. Review URL: https://codereview.chromium.org/38153003 git-svn-id: http://skia.googlecode.com/svn/trunk@11931 2bbb7eff-a529-9590-31e7-b0007b416f81
* [PDF] Add unpremultiply support and a GM (try4)Gravatar vandebo@chromium.org2013-10-23
| | | | | | | | | | | | This is a resubmit of https://codereview.chromium.org/22831039 which was reverted because it causes issues on Windows (really, release builds). BUG=chromium:175548 R=edisonn@google.com Review URL: https://codereview.chromium.org/33493003 git-svn-id: http://skia.googlecode.com/svn/trunk@11928 2bbb7eff-a529-9590-31e7-b0007b416f81
* Initial error handling codeGravatar commit-bot@chromium.org2013-10-23
| | | | | | | | | | | | | | | | I made it as simple as possible. The impact seems minimal and it should do what's necessary to make this code secure. BUG= Committed: http://code.google.com/p/skia/source/detail?r=11247 R=reed@google.com, scroggo@google.com, djsollen@google.com, sugoi@google.com, bsalomon@google.com, mtklein@google.com, senorblanco@google.com, senorblanco@chromium.org Author: sugoi@chromium.org Review URL: https://codereview.chromium.org/23021015 git-svn-id: http://skia.googlecode.com/svn/trunk@11922 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement SkColorFilter as a GrGLEffectGravatar commit-bot@chromium.org2013-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds GrEffect::willUseInputColor() which indicates whether or not the input color affects the output of the effect. This is needed for certain Xfermodes, such as kSrc_Mode. For these modes the color filter will not use the input color. An effect with GrEffect::willUseInputColor() true will cause all color or coverage effects before it to be discarded, as their computations cannot affect the output. In these cases program is marked as having white input color. This fixes an assert when Skia is compiled in a mode that prefers using uniforms instead of attributes for constants. (Flags GR_GL_USE_NV_PATH_RENDERING or GR_GL_NO_CONSTANT_ATTRIBUTES). Using attributes hides the problem where the fragment shader does not need input color for color filters that ignore DST part of the filter. The assert would be hit when uniform manager tries to bind an uniform which has been optimized away by the shader compiler. Adds specific GrGLSLExpr4 and GrGLSLExpr1 classes. This way the GLSL expressions like "(v - src.a)" can remain somewhat readable in form of "(v - src.a())". The GrGLSLExpr<typename> template implements the generic functionality, GrGLSLExprX is the specialization that exposes the type-safe interface to this functionality. Also adds operators so that GLSL binary operators of the form "(float * vecX)" can be expressed in C++. Before only the equivalent "(vecX * float)" was possible. This reverts the common blending calculations to more conventional order, such as "(1-a) * c" instead of "c * (1-a)". Changes GrGLSLExpr1::OnesStr from 1 to 1.0 in order to preserve the color filter blending formula string the same (with the exception of variable name change). Shaders change in case of input color being needed: - vec4 filteredColor; - filteredColor = (((1.0 - uFilterColor.a) * output_Stage0) + uFilterColor); - fsColorOut = filteredColor; + vec4 output_Stage1; + { // Stage 1: ModeColorFilterEffect + output_Stage1 = (((1.0 - uFilterColor_Stage1.a) * output_Stage0) + uFilterColor_Stage1); + } + fsColorOut = output_Stage1; Shaders change in case of input color being not needed: -uniform vec4 uFilterColor; -in vec4 vColor; +uniform vec4 uFilterColor_Stage0; out vec4 fsColorOut; void main() { - vec4 filteredColor; - filteredColor = uFilterColor; - fsColorOut = filteredColor; + vec4 output_Stage0; + { // Stage 0: ModeColorFilterEffect + output_Stage0 = uFilterColor_Stage0; + } + fsColorOut = output_Stage0; } R=bsalomon@google.com, robertphillips@google.com, jvanverth@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/25023003 git-svn-id: http://skia.googlecode.com/svn/trunk@11912 2bbb7eff-a529-9590-31e7-b0007b416f81
* add tests for SkDocumentGravatar commit-bot@chromium.org2013-10-22
| | | | | | | | | | R=reed@google.com, vandebo@chromium.org Author: edisonn@google.com Review URL: https://codereview.chromium.org/33423002 git-svn-id: http://skia.googlecode.com/svn/trunk@11907 2bbb7eff-a529-9590-31e7-b0007b416f81
* GrTHashCache -> GrTHashTableGravatar mtklein@google.com2013-10-21
| | | | | | | | | | | The class is Table, but the file's Cache. That's confusing. BUG= R=bsalomon@google.com Review URL: https://codereview.chromium.org/32523004 git-svn-id: http://skia.googlecode.com/svn/trunk@11898 2bbb7eff-a529-9590-31e7-b0007b416f81
* DM: add --serializeGravatar commit-bot@chromium.org2013-10-21
| | | | | | | | | | | | | | | | | Plus: - minor ReplayTask refactoring to share code with SerializeTask - move --replay to ReplayTask and --serialize to SerializeTask like WriteTask - when --writePath is given, write failures for Replay and Serialize tasks - function names have fewer blatant Skia style violations BUG= R=bsalomon@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/32613003 git-svn-id: http://skia.googlecode.com/svn/trunk@11890 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "[PDF] Add unpremultiply support and a GM (try3)."Gravatar vandebo@chromium.org2013-10-18
| | | | | | | | | | This is crashing in some configurations, can now repro. This reverts commit 12add177d0ab7bbac97f5093c9382924d88bde8c. Review URL: https://codereview.chromium.org/29903002 git-svn-id: http://skia.googlecode.com/svn/trunk@11868 2bbb7eff-a529-9590-31e7-b0007b416f81
* DM: add --writePathGravatar mtklein@google.com2013-10-18
| | | | | | | | | | | For fun, make the output prettier, hiding ", N failures" unless there is one. BUG= R=bsalomon@google.com Review URL: https://codereview.chromium.org/29293003 git-svn-id: http://skia.googlecode.com/svn/trunk@11867 2bbb7eff-a529-9590-31e7-b0007b416f81
* [PDF] Add unpremultiply support and a GM (try3).Gravatar vandebo@chromium.org2013-10-18
| | | | | | | | | | | | This is a resubmit of https://codereview.chromium.org/22831039 which was reverted because it causes issues on Windows. BUG=chromium:175548 R=edisonn@google.com Review URL: https://codereview.chromium.org/29193003 git-svn-id: http://skia.googlecode.com/svn/trunk@11866 2bbb7eff-a529-9590-31e7-b0007b416f81