Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Issue 614773004: Add tests for SkCanvas::drawImage[Rect]()

Created:
6 years, 2 months ago by Rémi Piotaix
Modified:
6 years, 2 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

Add tests for SkCanvas::drawImage[Rect]() BUG=skia:2947

Patch Set 1 #

Total comments: 4

Patch Set 2 : Cleaning test #

Patch Set 3 : Change dest rect in DrawImageRect test step #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -0 lines) Patch
M tests/CanvasTest.cpp View 1 2 3 chunks +10 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (1 generated)
Rémi Piotaix
PTAL
6 years, 2 months ago (2014-09-29 22:26:19 UTC) #2
reed1
This test is already very big (and therefore a bit hard to read/parse). Independent of ...
6 years, 2 months ago (2014-09-30 13:44:55 UTC) #3
Rémi Piotaix
This test may be big but is a good way to test the consistency between ...
6 years, 2 months ago (2014-09-30 15:44:50 UTC) #4
reed1
On 2014/09/30 15:44:50, Rémi Piotaix wrote: > This test may be big but is a ...
6 years, 2 months ago (2014-09-30 17:09:31 UTC) #5
Rémi Piotaix
> Is your change testing against different canvas / image subclasses? The test compares the ...
6 years, 2 months ago (2014-09-30 17:48:56 UTC) #6
Justin Novosad
https://codereview.chromium.org/614773004/diff/1/tests/CanvasTest.cpp File tests/CanvasTest.cpp (right): https://codereview.chromium.org/614773004/diff/1/tests/CanvasTest.cpp#newcode912 tests/CanvasTest.cpp:912: kTestImage = kTestSurface->newImageSnapshot(); I guess these globals could be ...
6 years, 2 months ago (2014-09-30 18:06:47 UTC) #7
Rémi Piotaix
> It is not tested with the different kinds of SkImages. But it is done ...
6 years, 2 months ago (2014-09-30 18:28:54 UTC) #8
Rémi Piotaix
https://codereview.chromium.org/614773004/diff/1/tests/CanvasTest.cpp File tests/CanvasTest.cpp (right): https://codereview.chromium.org/614773004/diff/1/tests/CanvasTest.cpp#newcode912 tests/CanvasTest.cpp:912: kTestImage = kTestSurface->newImageSnapshot(); On 2014/09/30 18:06:46, junov wrote: > ...
6 years, 2 months ago (2014-10-02 18:45:24 UTC) #9
Rémi Piotaix
New patch :)
6 years, 2 months ago (2014-10-03 20:18:08 UTC) #10
reed1
is the image that is being tested a single color? (from createSurface)? If so, how ...
6 years, 2 months ago (2014-10-06 12:46:09 UTC) #11
Rémi Piotaix
On 2014/10/06 12:46:09, reed1 wrote: > is the image that is being tested a single ...
6 years, 2 months ago (2014-10-06 15:04:47 UTC) #12
Rémi Piotaix
Ping?
6 years, 2 months ago (2014-10-08 17:16:37 UTC) #13
Rémi Piotaix
On 2014/10/08 17:16:37, Rémi Piotaix wrote: > Ping? Re-ping?
6 years, 2 months ago (2014-10-14 19:17:31 UTC) #14
Justin Novosad
On 2014/10/06 12:46:09, reed1 wrote: > is the image that is being tested a single ...
6 years, 2 months ago (2014-10-14 19:27:22 UTC) #15
reed1
On 2014/10/14 19:27:22, junov wrote: > On 2014/10/06 12:46:09, reed1 wrote: > > is the ...
6 years, 2 months ago (2014-10-15 14:16:48 UTC) #16
reed1
lgtm for this change, but I would like to understand how this test works, and ...
6 years, 2 months ago (2014-10-15 14:17:28 UTC) #17
Justin Novosad
On 2014/10/15 14:17:28, reed1 wrote: > lgtm for this change, but I would like to ...
6 years, 2 months ago (2014-10-15 14:32:32 UTC) #18
reed1
On 2014/10/15 14:32:32, junov wrote: > On 2014/10/15 14:17:28, reed1 wrote: > > lgtm for ...
6 years, 2 months ago (2014-10-15 14:44:37 UTC) #19
Justin Novosad
On 2014/10/15 14:44:37, reed1 wrote: > On 2014/10/15 14:32:32, junov wrote: > > On 2014/10/15 ...
6 years, 2 months ago (2014-10-15 15:01:20 UTC) #20
reed1
6 years, 2 months ago (2014-10-15 15:03:08 UTC) #21
On 2014/10/15 15:01:20, junov wrote:
> On 2014/10/15 14:44:37, reed1 wrote:
> > On 2014/10/15 14:32:32, junov wrote:
> > > On 2014/10/15 14:17:28, reed1 wrote:
> > > > lgtm for this change, but I would like to understand how this test
works,
> > and
> > > > its value.
> > > 
> > > The tests focus on validating SkCanvas state rather than pixels produced. 
> For
> > > example when you run command X on an SkPictureRecord, and query it state
> > > (Matrix, clip stack, layer count, etc.) It should be the same as if you
ran
> > > command X on a regular SkCanvas; and when you do the playback, the state
of
> > the
> > > playback canvas should also be the same.  These tests helped identify and
> > > correct side effects in many flavors of canvas.
> > 
> > That makes sense (I think) for state you can query (e.g. total-matrix). What
> > "state" are we checking when we make a draw-call? It seems to me that only
> state
> > is in its results.
> 
> So this test is less interesting for draw calls, which are not expected to
> affect state, but there have been cases where they did, as a side effect.  The
> test is mostly interesting for state-changing calls.
> The state we check is:
> 
> deviceSize,
> saveCount,
> isDrawingToLayer,
> getClipBounds (return value and bounds)
> getClipDeviceBounds (return value and bounds)
> getDrawFilter
> getTotalMatrix
> On the clip: isEmpty(), isRect()

Agreed. Perhaps we should remove the tests that are not useful (i.e. drawing
calls), just to make the test itself more clear and readable.

Powered by Google App Engine
This is Rietveld 408576698