skia2/tests
scroggo@google.com a2a3192847 Fix some extract subset bugs.
In SkBitmap::extractSubset, perform a deepCopy, if the pixelRef supports it.

Fixes a bug in the 'extractbitmap' gm, which attempts to draw a subset of a texture backed bitmap (if the canvas is really an SkGpuCanvas).

Also fix some bugs that happen when there is a pixel offset. These fixes get bypassed by the deepCopy, but a user can still set a pixel offset manually.

When copying GPU backed bitmap with a pixel offset, copy the offset.

If the new config is the same as the old, copy fRowBytes as well.

Add a function to SkBitmap.cpp (getUpperLeftFromOffset) to find the x,y coordinate to use when copying to a new config.

Fix a bug where readPixels copied to the correct desired config and we were setting the generation ID to match even though the desired config was not the same as the original config (caught by my new tests!).

Add some tests to verify the correct behavior.

Review URL: https://codereview.appspot.com/6839043

git-svn-id: http://skia.googlecode.com/svn/trunk@6710 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-12-07 19:14:45 +00:00
..
TestXCode/Tests.xcodeproj migrate more legacy unittests into tests/ 2009-03-07 03:39:23 +00:00
AAClipTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
AnnotationTest.cpp Defining new color constat for transparent color 2012-12-06 21:47:40 +00:00
AtomicTest.cpp Add a skia method to perform an atomic add. 2012-07-16 16:51:28 +00:00
BitmapCopyTest.cpp Revert r3219. r3219 was a revert of r3036. r3036 made extractSubset copy the opaque bit but was reverted because of a partally-loaded jpeg issue in WK which has since been fixed: 2012-10-12 13:42:36 +00:00
BitmapFactoryTest.cpp Create a factory to decode an SkBitmap from an SkData. 2012-11-29 21:05:37 +00:00
BitmapGetColorTest.cpp Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
BitmapHeapTest.cpp In SkBitmapHeap, defer adding owners for new bitmaps. 2012-11-16 20:34:37 +00:00
BitSetTest.cpp Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
BlitRowTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
BlurTest.cpp Remove warnings (trailing \, signed vs unsigned, parenthesization). 2011-10-27 15:27:51 +00:00
CanvasTest.cpp Update CanvasTest to do elementary tests for PDF too. 2012-10-18 15:58:23 +00:00
ChecksumTest.cpp Mark 64-bit constants as ULL to fix broken 32-bit Mac 10.6 build 2012-12-07 15:54:01 +00:00
ClampRangeTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
ClipCacheTest.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2012-12-07 02:01:25 +00:00
ClipCubicTest.cpp Defining new color constat for transparent color 2012-12-06 21:47:40 +00:00
ClipperTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
ClipStackTest.cpp Make the clip reducer operate on int rects. Remove redundant Gr from func 2012-12-06 14:23:20 +00:00
ColorFilterTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
ColorTest.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2012-10-13 02:01:56 +00:00
DataRefTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
DeferredCanvasTest.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2012-11-22 02:02:41 +00:00
DequeTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
DrawBitmapRectTest.cpp Defining new color constat for transparent color 2012-12-06 21:47:40 +00:00
DrawPathTest.cpp Defining new color constat for transparent color 2012-12-06 21:47:40 +00:00
DrawTextTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
EmptyPathTest.cpp Defining new color constat for transparent color 2012-12-06 21:47:40 +00:00
FillPathTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
FlatDataTest.cpp Fix broken test. 2012-08-14 19:30:20 +00:00
FlateTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
FontHostStreamTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
FontHostTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
GeometryTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
GLInterfaceValidation.cpp Move SK_SUPPORT_GPU checks below first #includes in case the macro is defined in SkUserConfig.h rather than by the build system. 2012-08-03 15:00:52 +00:00
GLProgramsTest.cpp Remove GrRandom API in favor of SkRandom. 2012-11-21 22:38:36 +00:00
GpuBitmapCopyTest.cpp Fix some extract subset bugs. 2012-12-07 19:14:45 +00:00
GradientTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
GrContextFactoryTest.cpp GrContextFactory can now expose the GLContext it is using. 2012-08-14 22:02:48 +00:00
GrMemoryPoolTest.cpp Fixed compilation issue when instance counting is disabled 2012-08-21 15:16:41 +00:00
HashCacheTest.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2012-09-19 02:01:47 +00:00
InfRectTest.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2012-11-09 02:01:24 +00:00
LListTest.cpp Fix stale iterators in LList test. Add newline to end of SkTLList.h 2012-12-04 14:48:57 +00:00
MathTest.cpp Suppress some warnings on linux. 2012-09-26 13:08:56 +00:00
Matrix44Test.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2012-12-06 02:01:25 +00:00
MatrixTest.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2012-12-04 02:01:25 +00:00
MemsetTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
MetaDataTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
PackBitsTest.cpp Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
PaintTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
ParsePathTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
PathCoverageTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
PathMeasureTest.cpp Fix test_small_segments3 path measure test. 2012-10-03 19:10:31 +00:00
PathTest.cpp check for bad enum use when adding contours 2012-11-26 18:16:27 +00:00
PDFPrimitivesTest.cpp [PDF] Fix name generation - / needs to be escaped. 2012-09-21 17:50:50 +00:00
PictureTest.cpp Handle recording a bitmap if copy fails. 2012-12-04 15:08:56 +00:00
PictureUtilsTest.cpp Updated make_filepath test to reflect changes in picture_utils. TBR 2012-07-13 18:43:39 +00:00
PipeTest.cpp Defining new color constat for transparent color 2012-12-06 21:47:40 +00:00
PointTest.cpp Change comment in PointTest to refer to GCC bug 2012-08-27 13:14:46 +00:00
PremulAlphaRoundTripTest.cpp 1. remove references to (deprecated) SkGpuCanvas 2012-10-01 17:54:05 +00:00
QuickRejectTest.cpp Defining new color constat for transparent color 2012-12-06 21:47:40 +00:00
Reader32Test.cpp Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
ReadPixelsTest.cpp 1. remove references to (deprecated) SkGpuCanvas 2012-10-01 17:54:05 +00:00
ReadWriteAlphaTest.cpp 1. remove references to (deprecated) SkGpuCanvas 2012-10-01 17:54:05 +00:00
RefCntTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
RefDictTest.cpp Extended Inst counting to find "unknown" leaked object (SkTMaskGamma) 2012-08-16 14:58:06 +00:00
RegionTest.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2012-11-08 02:03:56 +00:00
RoundRectTest.cpp Fixed remaining clang compiler warnings 2012-12-03 17:35:19 +00:00
RTreeTest.cpp Suppress some warnings on linux. 2012-09-26 13:08:56 +00:00
ScalarTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
ShaderOpacityTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
Sk64Test.cpp remove SK_CAN_USE_FLOAT (deprecated) 2012-06-11 21:21:26 +00:00
skia_test.cpp Remove legacy flag for android from tests 2012-11-29 16:29:58 +00:00
SortTest.cpp Split off SkConsistentChecksum from SkChecksum 2012-11-02 18:35:04 +00:00
SrcOverTest.cpp Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
StreamTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
StringTest.cpp Add option to gm: write out images into a hierarchy, rather than a flat set of files 2012-10-29 16:42:11 +00:00
StrokeTest.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2012-11-21 02:02:25 +00:00
Test.cpp Fix the gr/gl destruction order in Test.cpp 2012-11-29 17:27:37 +00:00
Test.h Fix test app to ensure that we destroy our GPU resources. 2012-11-29 15:28:45 +00:00
TestClassDef.h Skip test GLPrograms test when GL or Gr context can't be created. 2011-08-24 03:29:11 +00:00
TestSize.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
TileGridTest.cpp Unit testing for SkTileGrid 2012-11-07 17:38:38 +00:00
TLSTest.cpp Add a callback to cleanup TLS data on Windows. 2012-10-25 19:12:40 +00:00
ToUnicode.cpp Fixed Windows compiler complaints 2012-07-10 17:30:58 +00:00
TriangulationTest.cpp Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
UnicodeTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00
UtilsTest.cpp Extended Inst counting to find "unknown" leaked object (SkTMaskGamma) 2012-08-16 14:58:06 +00:00
valgrind.supp Close a couple of minor memory leaks, add a valgrind suppression file to 2012-03-15 18:16:39 +00:00
WArrayTest.cpp Fix metrics test to no longer include the cpp. 2012-06-25 17:01:46 +00:00
WritePixelsTest.cpp 1. remove references to (deprecated) SkGpuCanvas 2012-10-01 17:54:05 +00:00
Writer32Test.cpp truncate our llist w/ null during rewind. 2012-08-31 20:17:56 +00:00
XfermodeTest.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:14:13 +00:00