aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SurfaceTest.cpp
Commit message (Collapse)AuthorAge
* Fix memory leaks in SurfaceClear_Gpu testGravatar bsalomon2016-02-05
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1672083002 Review URL: https://codereview.chromium.org/1672083002
* Remove deferred clear from SkGpuDeviceGravatar bsalomon2016-02-05
| | | | | | | | | | | | | | | Add combining to GrClearBatch Fix issue with state tracking in GrGLGpu::createTestingOnlyBackendTexture Add tests for clearing GPU SkSurfaces and add tests for GrDrawContext::clear(). Add comment that SkCanvas::flush will resolve the RT in the GPU case. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1658823002 Review URL: https://codereview.chromium.org/1658823002
* allow the caller to specified raster-surface rowbytes.Gravatar reed2016-01-30
| | | | | | | | | along the way, simplify how we copy the surface's bitmap BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1643873002 Review URL: https://codereview.chromium.org/1643873002
* Reland of move drawSprite from canvas (patchset #1 id:1 of ↵Gravatar reed2015-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1529803004/ ) Reason for revert: guard has landed in chrome Original issue's description: > Revert of remove drawSprite from canvas (patchset #4 id:60001 of https://codereview.chromium.org/1534443003/ ) > > Reason for revert: > need to remove an override in chrome > > Original issue's description: > > remove drawSprite from canvas > > > > BUG=skia: > > > > Committed: https://skia.googlesource.com/skia/+/4657ce2324ea197507c4ba728d81138f56da13b1 > > TBR=fmalita@chromium.org,robertphillips@google.com,senorblanco@chromium.org,mtklein@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/32704674f64cb6a14356dfebe060cd3484c06cc7 TBR=fmalita@chromium.org,robertphillips@google.com,senorblanco@chromium.org,mtklein@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1530203002
* Revert of remove drawSprite from canvas (patchset #4 id:60001 of ↵Gravatar reed2015-12-16
| | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1534443003/ ) Reason for revert: need to remove an override in chrome Original issue's description: > remove drawSprite from canvas > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/4657ce2324ea197507c4ba728d81138f56da13b1 TBR=fmalita@chromium.org,robertphillips@google.com,senorblanco@chromium.org,mtklein@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1529803004
* remove drawSprite from canvasGravatar reed2015-12-16
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1534443003
* 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
* Move SkImage tests from SurfaceTest to ImageTestGravatar kkinnunen2015-11-17
| | | | | | | | | | | The general SkImage features seem to be tested in ImageTest instead of SurfaceTest. Helps in reviewing further reformatting of SurfaceTest. BUG=skia:2992 Review URL: https://codereview.chromium.org/1452123002
* Fix leaks in unit tests of GrGLTextureInfosGravatar bsalomon2015-11-11
| | | | | | TBR=egdaniel@google.com Review URL: https://codereview.chromium.org/1433353005
* Use a struct for client GL texture handlesGravatar bsalomon2015-11-10
| | | | Review URL: https://codereview.chromium.org/1429863009
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* Style Change: SkNEW->new; SkDELETE->deleteGravatar halcanary2015-08-26
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316123003 Review URL: https://codereview.chromium.org/1316123003
* flag to use const& instead of const* for src-rectGravatar reed2015-08-06
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1272713005
* SkSurface copy-on-write can yield stale GPU render targets.Gravatar fmalita2015-08-06
| | | | | | | | | | | | | | Prepare_rt_for_external_access() grabs the render target and then fires access notifications. But the notification handlers may trigger copy-on-write, causing the returned render target to be stale (pointing at the detached snapshot). We should grab the render target after firing notifications. R=reed@google.com,bsalomon@google.com Review URL: https://codereview.chromium.org/1276713002
* IWYU: 'core' target, files starting A-C.Gravatar bungeman2015-08-05
| | | | | | | | | TBR=reed@google.com Verbal lgtm, does not change API. Committed: https://skia.googlesource.com/skia/+/7403d87db8e43d4c2b5b25ac22a0ebc22bd09d69 Review URL: https://codereview.chromium.org/1265033002
* Revert of IWYU: 'core' target, files starting A-C. (patchset #5 id:80001 of ↵Gravatar reed2015-08-04
| | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1265033002/ ) Reason for revert: revert to unblock DEPS roll ../../chrome/browser/chromeos/display/overscan_calibrator.cc:43:10: error: variable has incomplete type 'SkPath' SkPath base_path; Original issue's description: > IWYU: 'core' target, files starting A-C. > > TBR=reed@google.com > Verbal lgtm, does not change API. > > Committed: https://skia.googlesource.com/skia/+/7403d87db8e43d4c2b5b25ac22a0ebc22bd09d69 TBR=reed@google.com,mtklein@google.com,bungeman@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1273613002
* IWYU: 'core' target, files starting A-C.Gravatar bungeman2015-08-04
| | | | | | | TBR=reed@google.com Verbal lgtm, does not change API. Review URL: https://codereview.chromium.org/1265033002
* Remove test of illegal behavior that modifies a texture backing an SkImage.Gravatar bsalomon2015-07-23
| | | | Review URL: https://codereview.chromium.org/1244143004
* Revert[2] of guard to remove DrawBitmapRectFlagsGravatar reed2015-07-17
| | | | | | | | | This reverts commit 91110195a2eee170c11885da9d16f94b00a39f87. BUG=skia: TBR= Review URL: https://codereview.chromium.org/1240753003
* Revert of guard to remove DrawBitmapRectFlags (patchset #1 id:1 of ↵Gravatar scroggo2015-07-17
| | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1235393003/) Reason for revert: breaking android framework build Original issue's description: > guard to remove DrawBitmapRectFlags > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/6fb0b6779e40ce05c20cf279f0ecff31fa3cd60d TBR=fmalita@chromium.org,djsollen@google.com,reed@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1230823007
* Revert of Remove rt flags that are not necessary (patchset #1 id:1 of ↵Gravatar bsalomon2015-07-16
| | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1226123012/) Reason for revert: breaks tests, e.g. https://build.chromium.org/p/client.skia.android/builders/Test-Android-GCC-Nexus9-GPU-TegraK1-Arm64-Release/builds/752/steps/dm/logs/stdio Original issue's description: > Remove rt flags that are not necessary > > Committed: https://skia.googlesource.com/skia/+/b6b0a6ef179f4143c94ba7e0e1be6e7ce4b0a23a TBR=joshualitt@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1234503004
* Remove rt flags that are not necessaryGravatar bsalomon2015-07-16
| | | | Review URL: https://codereview.chromium.org/1226123012
* guard to remove DrawBitmapRectFlagsGravatar reed2015-07-16
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1235393003
* Rename backing texture testing routinesGravatar jvanverth2015-07-14
| | | | Review URL: https://codereview.chromium.org/1230193006
* Remove GL-specific code from GMs and testsGravatar jvanverth2015-07-13
| | | | | | TBR=bsalomon@google.com Review URL: https://codereview.chromium.org/1232173002
* Fix SkImage::asLegacyBitmap() rowBytes assertGravatar fmalita2015-07-09
| | | | | | | | When reusing the pixel ref, we need to observe its rowBytes. R=reed@google.com Review URL: https://codereview.chromium.org/1227413002
* add ability to get FBO ID to SurfaceGravatar joshualitt2015-07-08
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1220733007
* Add image->bitmapGravatar reed2015-07-08
| | | | | | | | BUG=skia: patch from issue 1212163012 at patchset 1 (http://crrev.com/1212163012#ps1) Review URL: https://codereview.chromium.org/1208993017
* explicitly bump legacy genID on gpu surfaceGravatar reed2015-07-03
| | | | | | | | | | | | Previous attempt to "test" getTextureHandle was giving false-positive because we had an active image-snapshot, which was incidentally also triggering a new genID. I think this CL will also enable this change: https://codereview.chromium.org/1222243002/ BUG=skia: TBR=bsalomon@google.com NOTREECHECKS=True Review URL: https://codereview.chromium.org/1208993008
* Add SkSurface factory for wrapping an FBO in SkSurfaceGravatar bsalomon2015-06-30
| | | | Review URL: https://codereview.chromium.org/1221853003
* augment surface tests to check legacy genIDGravatar reed2015-06-29
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1219793002
* add getTextureHandle to SkSurfaceGravatar reed2015-06-29
| | | | | | BUG=485243 Review URL: https://codereview.chromium.org/1210303003
* Revert of Revert of Return GrGLContext from GrTestTarget (patchset #1 id:1 ↵Gravatar reed2015-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of https://codereview.chromium.org/1211123004/) Reason for revert: un-referting, did not help DEPS roll Original issue's description: > Revert of Return GrGLContext from GrTestTarget (patchset #3 id:40001 of https://codereview.chromium.org/1207393002/) > > Reason for revert: > speculative revert to unblock DEPS roll (layout-tests) > > Original issue's description: > > Return GrGLContext from GrTestTarget > > > > BUG=skia: > > > > Committed: https://skia.googlesource.com/skia/+/b6d93ea428ca5d13641c35faca7d0380980a3a17 > > TBR=bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/1852ec2b46a2a0efbb3550ff4d8b640f56a810e9 TBR=bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1215593002
* Revert of Return GrGLContext from GrTestTarget (patchset #3 id:40001 of ↵Gravatar reed2015-06-25
| | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1207393002/) Reason for revert: speculative revert to unblock DEPS roll (layout-tests) Original issue's description: > Return GrGLContext from GrTestTarget > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/b6d93ea428ca5d13641c35faca7d0380980a3a17 TBR=bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1211123004
* Return GrGLContext from GrTestTargetGravatar joshualitt2015-06-25
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1207393002
* Make SkGpuDevice know its alpha typeGravatar bsalomon2015-06-23
| | | | | | | | Make SkImage_Gpu snapshots opaque if surface is opaque. BUG=skia:3965 Review URL: https://codereview.chromium.org/1205643002
* change old picture serialization to really handle imagesGravatar reed2015-06-22
| | | | | | BUG=skia:3965 Review URL: https://codereview.chromium.org/1199473002
* add callbacks to Images that wrap client-provided contentGravatar reed2015-06-18
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1169553003
* Don't clear in SkSurface::NewWrappedRenderTargetGravatar bsalomon2015-06-16
| | | | Review URL: https://codereview.chromium.org/1191513002
* Implement support for mixed sampled render targetsGravatar vbuzinov2015-06-12
| | | | | | | | | | | | | | | | | | Adds a new FBO type kStencil_MSFBOType that is selected whenever NV_framebuffer_mixed_samples extension is available. In this new FBO type a non-msaa color buffer is created with a multisampled stencil buffer attachment. Replaces numSamples() with separate numColorSamples and numStencilSamples methods in RenderTarget. In mixed samples mode non-MSAA codepaths are used to draw simple shapes, while NVPR-rendered paths and text are rendered with a multisampled stencil. BUG=skia:3177 Review URL: https://codereview.chromium.org/1001503002
* Towards removing getTexture() on SkImageGravatar bsalomon2015-06-10
| | | | Review URL: https://codereview.chromium.org/1166993002
* Revert[2] SkDraw and all Blitters to use pixmap instead of bitmapiGravatar reed2015-06-09
| | | | | | | | This reverts commit b3f0ec9f9967da2f80f0d842cb7fd53617b48de3. BUG=skia: Review URL: https://codereview.chromium.org/1168303006
* new image from backend descGravatar reed2015-05-07
| | | | | | BUG=485243 Review URL: https://codereview.chromium.org/1121813002
* This replaces the texture creation/caching functions on GrContext with a ↵Gravatar bsalomon2015-04-30
| | | | | | GrTextureProvider interface. The goal is to pass this narrowly focused object in places that currently take a GrContext but don't need and shouldn't use its other methods. It also has an extended private interface for interacting with non-texture resource types. Review URL: https://codereview.chromium.org/1107973004
* Yet more ASAN fixes.Gravatar senorblanco2015-04-21
| | | | | | | | | More nullptr checks for factories I have added. Other checks more Yoda-like I have made. (Skia style this is.) BUG=skia: Review URL: https://codereview.chromium.org/1086393004
* Another speculative ASAN fix.Gravatar senorblanco2015-04-21
| | | | | | | | Add a GrContext nullptr check in SurfaceTest. TBR=robertphillips@google.com Review URL: https://codereview.chromium.org/1098993004
* Add helper for creating a SkSurface from a client created texture.Gravatar bsalomon2015-04-08
| | | | Review URL: https://codereview.chromium.org/1071603002
* guarded change to SkImageGenerator to make getInfo() constGravatar reed2015-03-19
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1017293002
* Split out methods in GrGpuResource::CacheAccess that can be called outside ↵Gravatar bsalomon2015-02-13
| | | | | | of the cache. Review URL: https://codereview.chromium.org/923143002
* Don't leak image in Surface test.Gravatar mtklein2015-01-24
| | | | | | | | | | | | | | | | | | | | | | ==7023== 5,056 (896 direct, 4,160 indirect) bytes in 8 blocks are definitely lost in loss record 947 of 2,656 ==7023== at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==7023== by 0x82CB99: SkNewImageFromBitmapTexture(SkBitmap const&, int, SkSurface::Budgeted) (SkImage_Gpu.cpp:64) ==7023== by 0x81A1CF: SkSurface_Gpu::onNewImageSnapshot(SkSurface::Budgeted) (SkSurface_Gpu.cpp:50) ==7023== by 0x694F9D: SkSurface::newImageSnapshot(SkSurface::Budgeted) (SkSurface_Base.h:92) ==7023== by 0x55EA7C: test_Surface(skiatest::Reporter*, GrContextFactory*) (SurfaceTest.cpp:485) ==7023== by 0x407CB2: run_test(skiatest::Test*) (DM.cpp:399) ==7023== by 0x408382: run_enclave_and_gpu_tests(SkTArray<Task, false>*) (DM.cpp:411) ==7023== by 0x68B71E: SkTaskGroup::wait() (SkTaskGroup.cpp:67) ==7023== by 0x40934E: dm_main() (DM.cpp:455) ==7023== by 0x409483: main (DM.cpp:477) http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind/builds/276/steps/dm/logs/stdio TBR=bsalomon@google.com BUG=skia: Review URL: https://codereview.chromium.org/872183002