aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm
Commit message (Collapse)AuthorAge
...
* Revert of Make NVPR a GL context option instead of a GL context (patchset #2 ↵Gravatar bsalomon2015-12-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:20001 of https://codereview.chromium.org/1448883002/ ) Reason for revert: BUG=skia:4609 skbug.com/4609 Seems like GrContextFactory needs to fail when the NVPR option is requested but the driver version isn't sufficiently high. Original issue's description: > Make NVPR a GL context option instead of a GL context > > Make NVPR a GL context option instead of a GL context. > This may enable NVPR to be run with command buffer > interface. > > No functionality change in DM or nanobench. NVPR can > only be run with normal GL APIs. > > BUG=skia:2992 > > Committed: https://skia.googlesource.com/skia/+/eeebdb538d476c1bfc8b63a946094ca1b505ecd1 TBR=mtklein@google.com,jvanverth@google.com,kkinnunen@nvidia.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:2992 Review URL: https://codereview.chromium.org/1486153002
* Make NVPR a GL context option instead of a GL contextGravatar kkinnunen2015-12-01
| | | | | | | | | | | | | Make NVPR a GL context option instead of a GL context. This may enable NVPR to be run with command buffer interface. No functionality change in DM or nanobench. NVPR can only be run with normal GL APIs. BUG=skia:2992 Review URL: https://codereview.chromium.org/1448883002
* Add debug option to clip each GrBatch to its device boundsGravatar bsalomon2015-11-30
| | | | Review URL: https://codereview.chromium.org/1471083002
* Generate list of GPU contexts outside SurfaceTest testsGravatar kkinnunen2015-11-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for feeding the tests with contexts directly to the unit test framework. This fixes the problem where tests are more complex than needed just in order to run the test code with multiple backends. Also makes it possible to change the logic how contexts are created. Instead of direct numbering, the different testable contexts may be generated from filtered cross-product of context options. For example: currently NVPR is a type of context. However, it could be also an on/off feature of any context. In order to test this kind of context, the enumeration can not be just of context type. It's simpler to move the enumeration out of the tests. A test targeting both normal and GPU backends would look like: static void test_obj_behavior(skiatest::Reporter* reporter, SkObj* obj, [other params] ) { ... test with obj and param .. } DEF_TEST(ObjBehavior, reporter) { for (auto& object : generate_object) { for (auto& other_param : generate_other_variant) { test_obj_behavior(reporter, object, other_param); } } } #if SK_SUPPORT_GPU DEF_GPUTEST_FOR_ALL_CONTEXTS(ObjBehavior_Gpu, reporter, context) { for (auto& object : generate_gpu_object) { for (auto& other_param : generate_other_variant) { test_obj_behavior(reporter, object, other_param); } } } #endif Uses the feature in SurfaceTests as an example. Moves SkSurface -related tests from ImageTest to SurfaceTest. BUG=skia:2992 Review URL: https://codereview.chromium.org/1446453003
* Make SkAndroidCodec support gifGravatar msarett2015-11-17
| | | | | | | | | Involves a few bug fixes in SkCodec_libgif and a bit more complexity in SkSwizzler. BUG=skia:4405 Review URL: https://codereview.chromium.org/1445313002
* Make SkAndroidCodec support bmpGravatar msarett2015-11-17
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1443783002
* Make SkAndroidCodec support wbmpGravatar msarett2015-11-16
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1445643002
* Remove dependency on src/android from dm and nanobenchGravatar msarett2015-11-13
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1443033002
* Replace SkFunction with std::functionGravatar mtklein2015-11-12
| | | | | | | TBR=reed@google.com No public API changes. Review URL: https://codereview.chromium.org/1441753002
* Reorganize BRD code in new tools directoryGravatar msarett2015-11-10
| | | | | | | | | | | | Rename SkCodecTools.h to SkBitmapRegionDecoderPriv.h Move BRD code to its own directory in tools. This allows us to not need to expose the entire tools directory in Android. BUG=skia: Review URL: https://codereview.chromium.org/1417393004
* Delete dead BitmapRegionDecoder code in toolsGravatar msarett2015-11-10
| | | | | | | | | | | This approach to subset decoding is no longer supported. We have replaced it with an implementation that does not depend on forked libraries. https://codereview.chromium.org/1406153015/ BUG=skia: Review URL: https://codereview.chromium.org/1406033007
* Delete dead subset test code from dmGravatar msarett2015-11-10
| | | | | | | | | | | This approach to subset decoding is no longer supported. We have replaced it with an implementation that does not depend on forked libraries. https://codereview.chromium.org/1406153015/ BUG=skia: Review URL: https://codereview.chromium.org/1416673010
* Comments Style: s/skbug.com/bug.skia.org/Gravatar halcanary2015-11-07
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1432503003 Review URL: https://codereview.chromium.org/1432503003
* Fix the build on Android devicesGravatar Matt Sarett2015-11-06
|
* Rename SkBitmapRegionDecoder and Create functionGravatar msarett2015-11-06
| | | | | | | | | | | | | We no longer need to worry about namespace conflicts SkBitmapRegionDecoder in Android (which we are replacing). Additionally, the static Create() function does not need to repeat the name BitmapRegionDecoder. BUG=skia: Review URL: https://codereview.chromium.org/1415243007
* Fix an error messageGravatar scroggo2015-11-04
| | | | | | | | Remove double negative. Also, change another error message to be slightly (meaningfully) different so I can find the right one based on the log. Review URL: https://codereview.chromium.org/1424083004
* Combine native sampling with samplingGravatar scroggo2015-11-03
| | | | | | | | | | | | In SkSampledCodec, allow the native codec to do its scaling first, then sample on top of that. Since the only codec which can do native scaling is JPEG, and we know what it can do, hard-code for JPEG. Check to see if the sampleSize is something JPEG supports, or a multiple of something it supports. If so, use JPEG directly or combine them. BUG=skia:4320 Review URL: https://codereview.chromium.org/1417583009
* DM+VB: WallTimer -> SkTime::GetNSecs().Gravatar mtklein2015-11-03
| | | | | | | | The same timer with a simpler interface. BUG=skia: Review URL: https://codereview.chromium.org/1427033003
* Add missing include for sleep().Gravatar scroggo2015-10-28
| | | | | | | | | | | | | | This used to be leaked unconditionally by libc++. Change-Id: I984ab7328ff3a2499c3c89a6862feaa62b6166de Author: Dan Albert<danalbert@google.com> Cherry-pick of https://android-review.googlesource.com/#/c/178189/1 This fixes the AOSP mips build. Review URL: https://codereview.chromium.org/1425843003
* Make DMSrcSink fail fatally when decodeRegion() fails for BRDSrcsGravatar msarett2015-10-27
| | | | | | | | | | This involves disabling webps for kCanvas_Strategy. We have not yet implemented webp subset decodes for this strategy. BUG=skia:4521 Review URL: https://codereview.chromium.org/1405273004
* Refactor SkBitmapRegionDecoderInterface for AndroidGravatar msarett2015-10-27
| | | | | | | | | | The result SkBitmap, the pixel allocator, and the alpha preference need to be communicated from the client to the region decoder. BUG=skia: Review URL: https://codereview.chromium.org/1418093006
* Fix DMSrcSink bugGravatar msarett2015-10-27
| | | | | | | | We want to request premultiplied decodes. BUG=skia: Review URL: https://codereview.chromium.org/1419403003
* Simplify linkages to Android framework internalsGravatar tomhudson2015-10-26
| | | | | | | | | | We've migrated SkHwuiRenderer into the Android Framework as android::uirenderer::TestWindowContext in response to an internal bug; we now delete that class and change our build references here. R=djsollen@google.com Review URL: https://codereview.chromium.org/1407053009
* Add immediate mode option for gpu configs in dmGravatar bsalomon2015-10-23
| | | | Review URL: https://codereview.chromium.org/1421853002
* Implementation of SkBitmapRegionDecoder using SkAndroidCodecGravatar msarett2015-10-22
| | | | | | | | Includes testing in DM and nanobench BUG=skia: Review URL: https://codereview.chromium.org/1402863002
* Fix uninitialized memory on kIndex8 divisor tests in GoldGravatar msarett2015-10-21
| | | | | | | | | | | | | Turns out bitmap.eraseColor() does nothing if the bitmap is kIndex8. We need a more reliable way to initialize all of the pixels that we look at in Gold. The input SkCanvas* is always zero initialized, so let's only draw pixels to the canvas if we have initialized them. BUG=skia: Review URL: https://codereview.chromium.org/1418913002
* SkRemote: more refactoringGravatar mtklein2015-10-21
| | | | | | | | | | | | - move Client / Server definitions to .cpp - rename Client / Server to Canvas / Decoder No diffs: https://gold.skia.org/search2?issue=1409113005&unt=true&query=source_type%3Dgm&master=false&include=true BUG=skia: Review URL: https://codereview.chromium.org/1409113005
* SkRemote: refactoringGravatar mtklein2015-10-21
| | | | | | | | | | | | | | | - Cache becomes CachingEncoder that wraps another Encoder - Encoders provide IDs - syntaxy improvements to Client - ID isn't really protocol sensitive. - I don't think we need Type::kNone. No diffs. https://gold.skia.org/search2?issue=1418863002&unt=true&query=source_type%3Dgm&master=false&include=true BUG=skia: Review URL: https://codereview.chromium.org/1418863002
* Create an SkAndroidCodec API separate from SkCodecGravatar msarett2015-10-21
| | | | | | | | | | | | We will implement this API using SkCodecs. SkAndroidCodecs will be used to implement the BitmapRegionDecoder Java API (and possibly BitmapFactory). BUG=skia: Review URL: https://codereview.chromium.org/1406223002
* SkRemoteGravatar mtklein2015-10-16
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1391023005
* SkTHash: hash from fnptr to functor typeGravatar mtklein2015-10-15
| | | | | | | | Passing &SkGoodHash to SkTHashMap and SkTHashSet doesn't guarantee that it's actually instantiated. Using a functor does. BUG=skia: Review URL: https://codereview.chromium.org/1405053002
* Add subsetting to SkScanlineDecoderGravatar msarett2015-10-13
| | | | | | | | | | | | This CL allows the SkScanlineDecoder to decode partial scanlines. This is a first step in efficiently implementing subsetting in SkScaledCodec. BUG=skia:4209 Review URL: https://codereview.chromium.org/1390213002
* SkBitmapRegionDecoder clean-upGravatar msarett2015-10-12
| | | | | | | | | | | | | | Use SkCodecPrintf instead of SkDebugf. Check if the conversion is possible rather than starting many decodes that will certainly fail. Small refactor to code that deals with subsets that fall outside of the image. BUG=skia: Review URL: https://codereview.chromium.org/1395383002
* Enable more testing for scaled webpsGravatar msarett2015-10-12
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1401093002
* Fill incomplete images in SkCodec parent classGravatar msarett2015-10-09
| | | | | | | | | | | | | | | | | | | | | | | | | Rather than implementing some sort of "fill" in every SkCodec subclass for incomplete images, let's make the parent class handle this situation. This includes an API change to SkCodec.h SkCodec::getScanlines() now returns the number of lines it read successfully, rather than an SkCodec::Result enum. getScanlines() most often fails on an incomplete input, in which case it is useful to know how many lines were successfully decoded - this provides more information than kIncomplete vs kSuccess. We do lose information when the API is used improperly, as we are no longer able to return kInvalidParameter or kScanlineNotStarted. Known Issues: Does not work for incomplete fFrameIsSubset gifs. Does not work for incomplete icos. BUG=skia: Review URL: https://codereview.chromium.org/1332053002
* Update libwebp and resume testing scaled webpGravatar scroggo2015-10-01
| | | | | | | | | | | | | | | | | libwebp has a fix for [1]. Update to the commit that contains the fix. Update libwebp.gypi, corresponding to libwebp's latest makefile. Turn back on DM testing for scaled webp, now that it should no longer use uninitialized memory. [1] https://code.google.com/p/webp/issues/detail?id=254 BUG=skia:4038 Committed: https://skia.googlesource.com/skia/+/0575d3e6c272744a66ab3281f9871366717df339 Review URL: https://codereview.chromium.org/1280073002
* SkPDF: Implement drawImage*() properlyGravatar halcanary2015-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drawImage calls now properly embeds the original jpeg. NOTE: drawBitmap*() calls no longer embed JPEG files when possible (this is in advance of eliminating bitmaps backed by encoded data). Chromium has already moved from drawBitmap to drawImage. Comparisons: control: total PDF drawImage/drawBitmap calls: 8010 total PDF jpeg images: 0 total PDF regular images: 3581 experiament: total PDF drawImage/drawBitmap calls: 8014 total PDF jpeg images: 271 total PDF regular images: 3311 total PDF regular images: 3582 (271 + 3311) When comparing rendered output there were perceptual differences in the following four GMs: colorcube, emboss, colormatrix, and tablecolorfilter. All of these differences were improvements (that is, closer to the 8888 rendering) due fixing a bug with colorfilters and forgetting to call notifyPixelsChanged. No SKPs had perceptual differences. Total PDF size dropped from 133964 kB to 126276 kB, a 5.7% improvement (mostly due to restoring use of JPG images in SKPs). BUG=skia:4370 Review URL: https://codereview.chromium.org/1372783003
* Small DM cleanupGravatar scroggo2015-09-30
| | | | | | | We set a value to bounds, and then immediately replace it. Skip the first one. Review URL: https://codereview.chromium.org/1378923002
* Fix bug testing SkCodec for ICOGravatar scroggo2015-09-30
| | | | | | | | | | | | | | | | | | | | | Looking in Gold, I see some ICO images that only show the upper left corner of the originals. It is happening because we use different ways of deciding what the dimensions are: In CodecSrc::size(), we use an SkScaledCodec to get the dimensions, even when fMode is not kScaledCodec_Mode. In CodecSrc::draw(), we only use SkScaledCodec in kScaledCodec_Mode. My recent CL to combine SkScanlineDecoder with SkCodec revealed this bug, because now SkScaledCodec::NewFromStream will succeed on ICO. (Previously, it failed because we do not yet have a scanline decoder for ICO (skbug.com/4404). Now that they are combined, we would need to specially flag ICO to stop returning an SkScaledCodec.) Switch size() to use the correct type of codec. Review URL: https://codereview.chromium.org/1373253004
* Merge SkCodec with SkScanlineDecoderGravatar scroggo2015-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Benefits: - This mimics other decoding APIs (including the ones SkCodec relies on, e.g. a png_struct, which can be used to decode an entire image or one line at a time). - It allows a client to ask us to do what we can do efficiently - i.e. start from encoded data and either decode the whole thing or scanlines. - It removes the duplicate methods which appeared in both SkCodec and SkScanlineDecoder (some of which, e.g. in SkJpegScanlineDecoder, just call fCodec->sameMethod()). - It simplifies moving more checks into the base class (e.g. the examples in skbug.com/4284). BUG=skia:4175 BUG=skia:4284 ===================================================================== SkScanlineDecoder.h/.cpp: Removed. SkCodec.h/.cpp: Add methods, enums, and variables which were previously in SkScanlineDecoder. Default fCurrScanline to -1, as a sentinel that start has not been called. General changes: Convert SkScanlineDecoders to SkCodecs. General changes in SkCodec subclasses: Merge SkScanlineDecoder implementation into SkCodec. Most (all?) owned an SkCodec, so they now call this-> instead of fCodec->. SkBmpCodec.h/.cpp: Replace the unused rowOrder method with an override for onGetScanlineOrder. Make getDstRow const, since it is called by onGetY, which is const. SkCodec_libpng.h/.cpp: Make SkPngCodec an abstract class, with two subclasses which handle scanline decoding separately (they share code for decoding the entire image). Reimplement onReallyHasAlpha so that it can return the most recent result (e.g. after a scanline decode which only decoded part of the image) or a better answer (e.g. if the whole image is known to be opaque). Compute fNumberPasses early, so we know which subclass to instantiate. Make SkPngInterlaceScanlineDecoder use the base class' fCurrScanline rather than a separate variable. CodexTest.cpp: Add tests for the state changes in SkCodec (need to call start before decoding scanlines; calling getPixels means that start will need to be called again before decoding more scanlines). Add a test which decodes in stripes, currently only used for an interlaced PNG. TODO: Add tests for onReallyHasAlpha. Review URL: https://codereview.chromium.org/1365313002
* DM: PDFSink sets rasterizer keywordGravatar halcanary2015-09-28
| | | | Review URL: https://codereview.chromium.org/1376573002
* simplify code in SkRecords.hGravatar mtklein2015-09-28
| | | | | | | | | | | | | | | | - use C++11 features ({} init, move constructors) to eliminate the need for explicit constructors - collapse RECORD0...RECORD8 into just one RECORD macro - explicitly tag record types instead of using member detectors. Removing member detectors makes this code significantly less fragile. This exposes a few places where we didn't really think through what to do with SkDrawable. I've marked them TODO for now. BUG=skia: Review URL: https://codereview.chromium.org/1360943003
* SkInstallDiscardablePixelRef is deprecated, enforce thatGravatar reed2015-09-25
| | | | | | | | | No functionality change, just a renaming. BUG=skia: TBR= Review URL: https://codereview.chromium.org/1372593002
* SkPDF: add basic metadata supportGravatar halcanary2015-09-23
| | | | | | | | | Motivation: I want too finalize this API before working on the more complex problem of adding XMP metadata for PDF/A. BUG=skia:3110 Review URL: https://codereview.chromium.org/1359943003
* Add nanobench tests for BitmapRegionDecoderGravatar msarett2015-09-22
| | | | | | | | | | | | | | | | SkBitmapRegionDecoderInterface provides an interface for multiple implementations of Android's BitmapRegionDecoder. We already have correctness tests in DM that will enable us to compare the quality of our various BRD implementations. We also need these performance tests to compare the speed of our various implementations. BUG=skia:4357 Review URL: https://codereview.chromium.org/1344993003
* fix DM?Gravatar mtklein2015-09-22
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1359833005
* Use rounding when converting desiredScale to a sampleSizeGravatar msarett2015-09-18
| | | | | | | | | | | | | | | | | | | | | Right now we have a bug in Gold where some images are labeled _0.167 and others are labeled _0.166. They are all 1/6 scales and should be labeled the same way and compared. The fix involves changing 0.166 to 0.167 in the list of scales that we test on, but SkScaledCodec does not scale to 0.167 as I expected. SkScaledCodec converts 0.167 to sampleSize = 5.999 and then casts to sampleSize = 5. I would argue that we should do a true round, so 0.167 represents a sampleSize of 6. In general, this CL change onGetScaledDimensions so that we now round desiredScale to the nearest sampleSize. BUG=skia: Review URL: https://codereview.chromium.org/1356923002
* skia: Add ANGLE with GL backend to nanobench/DMGravatar hendrikw2015-09-11
| | | | | | | This will allow us to test this without hacking it in, might be useful for others too. Review URL: https://codereview.chromium.org/1338003002
* Remove jpegs with uninitialized memory from GoldGravatar msarett2015-09-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BitmapRegionSampler (uses SkImageDecoder) will often scale to a power of 2 regardless of the sampleSize requested. This is skbug.com/4319. Consider a 60x60 image. To decode a subset with sample size 3, we might ask for the following. [x, y, w, h] = [-15, -15, 30, 30] sampleSize = 3 Since w = 30 and h = 30, this should give us a 10x10 result. Only the bottom right 5x5 quadrant of this 10x10 subset will actually be in the image. We should get a 5 pixel border on the top and left because we ask for 15 extra pixels on the top and left. Unfortunately, SkImageDecoder will take our requested sample size of 3, and then decide to use a sample size of 2. Not only will it scale the image by 2, but it will also scale the border by 2. So while we are expecting pixel data to begin at offset (5, 5) of the result bitmap, it actually begins at offset (7, 7). Making things worse, the pixels between (5, 5) and (7, 7) are uninitialized, causing problems on Gold. Options for fixing this include: (1) Not testing decodes with a border. (2) Changing the test to check the size of the output bitmap. (3) Disable the tests. I think it's best to just disable these tests. We know they don't work, so why do we need to see the results on Gold? BUG=skia:4319 Review URL: https://codereview.chromium.org/1313233007
* DM: add --key and --properties to PNG description field.Gravatar mtklein2015-09-10
| | | | | | | | This tags each image with the bot that created it. BUG=skia:4322 Review URL: https://codereview.chromium.org/1332903002