Commit Graph

113 Commits

Author SHA1 Message Date
bsalomon
2fba809120 Fix memory leaks in SurfaceClear_Gpu test
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
2016-02-05 13:47:06 -08:00
bsalomon
e63ffef624 Remove deferred clear from SkGpuDevice
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
2016-02-05 07:17:34 -08:00
reed
9cd016e9b6 allow the caller to specified raster-surface rowbytes.
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
2016-01-30 10:01:06 -08:00
reed
da420b976e Reland of move drawSprite from canvas (patchset #1 id:1 of 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
2015-12-16 08:38:16 -08:00
reed
32704674f6 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:

Review URL: https://codereview.chromium.org/1529803004
2015-12-16 08:27:10 -08:00
reed
4657ce2324 remove drawSprite from canvas
BUG=skia:

Review URL: https://codereview.chromium.org/1534443003
2015-12-16 07:52:47 -08:00
kkinnunen
179a8f5f7f Generate list of GPU contexts outside SurfaceTest tests
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
2015-11-20 13:32:25 -08:00
kkinnunen
4e18413b78 Move SkImage tests from SurfaceTest to ImageTest
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
2015-11-17 22:53:28 -08:00
bsalomon
67d7620285 Fix leaks in unit tests of GrGLTextureInfos
TBR=egdaniel@google.com

Review URL: https://codereview.chromium.org/1433353005
2015-11-11 12:40:42 -08:00
bsalomon
091f60c2a0 Use a struct for client GL texture handles
Review URL: https://codereview.chromium.org/1429863009
2015-11-10 11:54:57 -08:00
halcanary
96fcdcc219 Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
2015-08-27 07:41:16 -07:00
halcanary
385fe4d4b6 Style Change: SkNEW->new; SkDELETE->delete
DOCS_PREVIEW= https://skia.org/?cl=1316123003

Review URL: https://codereview.chromium.org/1316123003
2015-08-26 13:07:49 -07:00
reed
e47829b6b1 flag to use const& instead of const* for src-rect
BUG=skia:

Review URL: https://codereview.chromium.org/1272713005
2015-08-06 10:02:53 -07:00
fmalita
e2639089bd SkSurface copy-on-write can yield stale GPU render targets.
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
2015-08-06 07:04:52 -07:00
bungeman
d3ebb48320 IWYU: 'core' target, files starting A-C.
TBR=reed@google.com
Verbal lgtm, does not change API.

Committed: https://skia.googlesource.com/skia/+/7403d87db8e43d4c2b5b25ac22a0ebc22bd09d69

Review URL: https://codereview.chromium.org/1265033002
2015-08-05 13:57:49 -07:00
reed
fb8c1fcab1 Revert of IWYU: 'core' target, files starting A-C. (patchset #5 id:80001 of 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
2015-08-04 18:44:57 -07:00
bungeman
7403d87db8 IWYU: 'core' target, files starting A-C.
TBR=reed@google.com
Verbal lgtm, does not change API.

Review URL: https://codereview.chromium.org/1265033002
2015-08-04 14:56:53 -07:00
bsalomon
a449779a33 Remove test of illegal behavior that modifies a texture backing an SkImage.
Review URL: https://codereview.chromium.org/1244143004
2015-07-23 12:22:19 -07:00
reed
84984efeb6 Revert[2] of guard to remove DrawBitmapRectFlags
This reverts commit 91110195a2.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1240753003
2015-07-17 07:09:43 -07:00
scroggo
91110195a2 Revert of guard to remove DrawBitmapRectFlags (patchset #1 id:1 of 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
2015-07-17 05:57:34 -07:00
bsalomon
bea0150d83 Revert of Remove rt flags that are not necessary (patchset #1 id:1 of 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
2015-07-16 10:00:28 -07:00
bsalomon
b6b0a6ef17 Remove rt flags that are not necessary
Review URL: https://codereview.chromium.org/1226123012
2015-07-16 09:34:57 -07:00
reed
6fb0b6779e guard to remove DrawBitmapRectFlags
BUG=skia:

Review URL: https://codereview.chromium.org/1235393003
2015-07-16 06:10:02 -07:00
jvanverth
8895792877 Rename backing texture testing routines
Review URL: https://codereview.chromium.org/1230193006
2015-07-14 11:02:52 -07:00
jvanverth
672bb7fc66 Remove GL-specific code from GMs and tests
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1232173002
2015-07-13 07:19:57 -07:00
fmalita
ea561bf055 Fix SkImage::asLegacyBitmap() rowBytes assert
When reusing the pixel ref, we need to observe its rowBytes.

R=reed@google.com

Review URL: https://codereview.chromium.org/1227413002
2015-07-09 17:10:31 -07:00
joshualitt
81793410a8 add ability to get FBO ID to Surface
BUG=skia:

Review URL: https://codereview.chromium.org/1220733007
2015-07-08 12:54:04 -07:00
reed
3c06511e91 Add image->bitmap
BUG=skia:

patch from issue 1212163012 at patchset 1 (http://crrev.com/1212163012#ps1)

Review URL: https://codereview.chromium.org/1208993017
2015-07-08 12:46:23 -07:00
reed
dca20ce4e1 explicitly bump legacy genID on gpu surface
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
2015-07-03 10:43:43 -07:00
bsalomon
d3e259a16c Add SkSurface factory for wrapping an FBO in SkSurface
Review URL: https://codereview.chromium.org/1221853003
2015-06-30 12:04:40 -07:00
reed
09b2c932d8 augment surface tests to check legacy genID
BUG=skia:

Review URL: https://codereview.chromium.org/1219793002
2015-06-29 14:09:41 -07:00
reed
fa5e68e4b4 add getTextureHandle to SkSurface
BUG=485243

Review URL: https://codereview.chromium.org/1210303003
2015-06-29 07:37:01 -07:00
reed
f9ad558943 Revert of Revert of Return GrGLContext from GrTestTarget (patchset #1 id:1 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
2015-06-25 21:29:25 -07:00
reed
1852ec2b46 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:

Review URL: https://codereview.chromium.org/1211123004
2015-06-25 18:59:32 -07:00
joshualitt
b6d93ea428 Return GrGLContext from GrTestTarget
BUG=skia:

Review URL: https://codereview.chromium.org/1207393002
2015-06-25 15:02:22 -07:00
bsalomon
74f681dce2 Make SkGpuDevice know its alpha type
Make SkImage_Gpu snapshots opaque if surface is opaque.

BUG=skia:3965

Review URL: https://codereview.chromium.org/1205643002
2015-06-23 14:38:48 -07:00
reed
871872f3f2 change old picture serialization to really handle images
BUG=skia:3965

Review URL: https://codereview.chromium.org/1199473002
2015-06-22 12:48:26 -07:00
reed
de49988bc2 add callbacks to Images that wrap client-provided content
BUG=skia:

Review URL: https://codereview.chromium.org/1169553003
2015-06-18 13:41:40 -07:00
bsalomon
7a61793d96 Don't clear in SkSurface::NewWrappedRenderTarget
Review URL: https://codereview.chromium.org/1191513002
2015-06-16 08:07:16 -07:00
vbuzinov
dded69693d Implement support for mixed sampled render targets
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
2015-06-12 08:59:45 -07:00
bsalomon
55812362f1 Towards removing getTexture() on SkImage
Review URL: https://codereview.chromium.org/1166993002
2015-06-10 08:49:28 -07:00
reed
41e010cb90 Revert[2] SkDraw and all Blitters to use pixmap instead of bitmapi
This reverts commit b3f0ec9f99.

BUG=skia:

Review URL: https://codereview.chromium.org/1168303006
2015-06-09 12:16:53 -07:00
reed
8b26b99c97 new image from backend desc
BUG=485243

Review URL: https://codereview.chromium.org/1121813002
2015-05-07 15:36:18 -07:00
bsalomon
d309e7aa0e This replaces the texture creation/caching functions on GrContext with a 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
2015-04-30 14:18:54 -07:00
senorblanco
c8e934007a Yet more ASAN fixes.
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
2015-04-21 07:20:36 -07:00
senorblanco
84bfd3958f Another speculative ASAN fix.
Add a GrContext nullptr check in SurfaceTest.

TBR=robertphillips@google.com

Review URL: https://codereview.chromium.org/1098993004
2015-04-21 06:59:17 -07:00
bsalomon
e4579adfdf Add helper for creating a SkSurface from a client created texture.
Review URL: https://codereview.chromium.org/1071603002
2015-04-08 08:38:40 -07:00
reed
3ef71e343b guarded change to SkImageGenerator to make getInfo() const
BUG=skia:

Review URL: https://codereview.chromium.org/1017293002
2015-03-19 08:31:14 -07:00
bsalomon
3582d3ee9f Split out methods in GrGpuResource::CacheAccess that can be called outside of the cache.
Review URL: https://codereview.chromium.org/923143002
2015-02-13 14:20:05 -08:00
mtklein
31ff29829e Don't leak image in Surface test.
==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
2015-01-24 11:27:27 -08:00