| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
| 9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
| 10 #include "SkMathPriv.h" | 10 #include "SkMathPriv.h" |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 /* | 569 /* |
| 570 * Test two different ways to turn a subset of a bitmap into a texture | 570 * Test two different ways to turn a subset of a bitmap into a texture |
| 571 * - subset and then upload to a texture | 571 * - subset and then upload to a texture |
| 572 * - upload to a texture and then subset | 572 * - upload to a texture and then subset |
| 573 * | 573 * |
| 574 * These two techniques result in the same pixels (ala readPixels) | 574 * These two techniques result in the same pixels (ala readPixels) |
| 575 * but when we draw them (rotated+scaled) we don't always get the same results. | 575 * but when we draw them (rotated+scaled) we don't always get the same results. |
| 576 * | 576 * |
| 577 * https://bug.skia.org/4351 | 577 * https://bug.skia.org/4351 |
| 578 */ | 578 */ |
| 579 DEF_GPUTEST_FOR_NATIVE_CONTEXT(ReadPixels_Subset_Gpu, reporter, context) { | 579 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadPixels_Subset_Gpu, reporter, context) { |
| 580 SkBitmap bitmap; | 580 SkBitmap bitmap; |
| 581 make_ringed_bitmap(&bitmap, 6, 6); | 581 make_ringed_bitmap(&bitmap, 6, 6); |
| 582 const SkIRect subset = SkIRect::MakeLTRB(2, 2, 4, 4); | 582 const SkIRect subset = SkIRect::MakeLTRB(2, 2, 4, 4); |
| 583 | 583 |
| 584 // make two textures... | 584 // make two textures... |
| 585 SkBitmap bm_subset, tx_subset; | 585 SkBitmap bm_subset, tx_subset; |
| 586 | 586 |
| 587 // ... one from a texture-subset | 587 // ... one from a texture-subset |
| 588 SkAutoTUnref<GrTexture> fullTx(GrRefCachedBitmapTexture(context, bitmap, | 588 SkAutoTUnref<GrTexture> fullTx(GrRefCachedBitmapTexture(context, bitmap, |
| 589 GrTextureParams::Cla
mpNoFilter())); | 589 GrTextureParams::Cla
mpNoFilter())); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 617 SkAutoTUnref<SkData> dataB(draw_into_surface(surfB.get(), tx_subset, qua
lity)); | 617 SkAutoTUnref<SkData> dataB(draw_into_surface(surfB.get(), tx_subset, qua
lity)); |
| 618 | 618 |
| 619 REPORTER_ASSERT(reporter, dataA->equals(dataB)); | 619 REPORTER_ASSERT(reporter, dataA->equals(dataB)); |
| 620 if (false) { | 620 if (false) { |
| 621 dump_to_file("test_image_A.png", dataA); | 621 dump_to_file("test_image_A.png", dataA); |
| 622 dump_to_file("test_image_B.png", dataB); | 622 dump_to_file("test_image_B.png", dataB); |
| 623 } | 623 } |
| 624 } | 624 } |
| 625 } | 625 } |
| 626 #endif | 626 #endif |
| OLD | NEW |