Make GrScratchKey memory buffer correct size on copy
authorkkinnunen <kkinnunen@nvidia.com>
Wed, 21 Jan 2015 14:39:14 +0000 (06:39 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 21 Jan 2015 14:39:14 +0000 (06:39 -0800)
commit711ef4831363fb8cbdf061dc2c36c65b13c0ccf2
tree71617221284467dd0cc91c5da158e3d5d5e540ca
parent034e94877b7e63033d9ae5435d8e3e45977921bc
Make GrScratchKey memory buffer correct size on copy

Scratch key memory buffer of a copy of a key was too big. The (new) copy
was N times uint32_t bytes instead of N bytes.

Adds few tests to resource cache. These tests would not catch the too
big buffer. This is just a precaution for too small buffers. The main
idea of the test change is that the scratch key should contain some
information, so that lookup with a scratch key can also return no
match. Otherwise testing of scratch lookup result is not indicative of
correct code (eg. no-information scratch key will always match).

Review URL: https://codereview.chromium.org/860333002
include/gpu/GrResourceKey.h
tests/ResourceCacheTest.cpp