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

Unified Diff: gm/gmmain.cpp

Issue 790643009: Revert of Fix layer hoisting image filter corner cases (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkLayerInfo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gmmain.cpp
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 9b2f9a13c2003710bcf3351e30b4f8457f05888e..da4184db673d9364688ef91f227d57ac871984cc 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -655,21 +655,18 @@
}
}
- static void generate_image_from_picture(GM* gm, const ConfigData& config,
- GrSurface* gpuTarget,
+ static void generate_image_from_picture(GM* gm, const ConfigData& gRec,
SkPicture* pict, SkBitmap* bitmap,
SkScalar scale = SK_Scalar1,
bool tile = false) {
- const SkISize size = gm->getISize();
-
- SkAutoTUnref<SkSurface> surf(CreateSurface(config, size, gpuTarget));
+ SkISize size = gm->getISize();
+ setup_bitmap(gRec, size, bitmap);
+
+ SkAutoTUnref<SkSurface> surf(SkSurface::NewRasterDirect(bitmap->info(),
+ bitmap->getPixels(),
+ bitmap->rowBytes()));
DrawPictureToSurface(surf, pict, scale, tile, false);
-
- setup_bitmap(config, size, bitmap);
-
- surf->readPixels(bitmap->info(), bitmap->getPixels(), bitmap->rowBytes(), 0, 0);
-
complete_bitmap(bitmap);
}
@@ -1633,12 +1630,10 @@
*
* Returns all errors encountered while doing so.
*/
-ErrorCombination run_multiple_modes(GMMain &gmmain, GM *gm,
- const ConfigData &compareConfig, GrSurface* gpuTarget,
+ErrorCombination run_multiple_modes(GMMain &gmmain, GM *gm, const ConfigData &compareConfig,
const SkBitmap &comparisonBitmap,
const SkTDArray<SkScalar> &tileGridReplayScales);
-ErrorCombination run_multiple_modes(GMMain &gmmain, GM *gm,
- const ConfigData &compareConfig, GrSurface* gpuTarget,
+ErrorCombination run_multiple_modes(GMMain &gmmain, GM *gm, const ConfigData &compareConfig,
const SkBitmap &comparisonBitmap,
const SkTDArray<SkScalar> &tileGridReplayScales) {
ErrorCombination errorsForAllModes;
@@ -1656,8 +1651,7 @@
errorsForAllModes.add(kIntentionallySkipped_ErrorType);
} else {
SkBitmap bitmap;
- gmmain.generate_image_from_picture(gm, compareConfig, gpuTarget, pict, &bitmap);
-
+ gmmain.generate_image_from_picture(gm, compareConfig, pict, &bitmap);
errorsForAllModes.add(gmmain.compare_test_results_to_reference_bitmap(
gm->getName(), compareConfig.fName, renderModeDescriptor, bitmap,
&comparisonBitmap));
@@ -1674,7 +1668,7 @@
SkPicture* repict = gmmain.stream_to_new_picture(*pict);
SkAutoTUnref<SkPicture> aurr(repict);
SkBitmap bitmap;
- gmmain.generate_image_from_picture(gm, compareConfig, gpuTarget, repict, &bitmap);
+ gmmain.generate_image_from_picture(gm, compareConfig, repict, &bitmap);
errorsForAllModes.add(gmmain.compare_test_results_to_reference_bitmap(
gm->getName(), compareConfig.fName, renderModeDescriptor, bitmap,
&comparisonBitmap));
@@ -1707,7 +1701,7 @@
SkPicture* pict = gmmain.generate_new_picture(gm, kRTree_BbhType, 0);
SkAutoTUnref<SkPicture> aur(pict);
SkBitmap bitmap;
- gmmain.generate_image_from_picture(gm, compareConfig, gpuTarget, pict, &bitmap);
+ gmmain.generate_image_from_picture(gm, compareConfig, pict, &bitmap);
errorsForAllModes.add(gmmain.compare_test_results_to_reference_bitmap(
gm->getName(), compareConfig.fName, renderModeDescriptor, bitmap,
&comparisonBitmap));
@@ -1740,7 +1734,7 @@
// We cannot yet pass 'true' to generate_image_from_picture to
// perform actual tiled rendering (see Issue 1198 -
// https://code.google.com/p/skia/issues/detail?id=1198)
- gmmain.generate_image_from_picture(gm, compareConfig, gpuTarget, pict, &bitmap,
+ gmmain.generate_image_from_picture(gm, compareConfig, pict, &bitmap,
replayScale /*, true */);
errorsForAllModes.add(gmmain.compare_test_results_to_reference_bitmap(
gm->getName(), compareConfig.fName, renderModeDescriptor.c_str(), bitmap,
@@ -1881,7 +1875,7 @@
// TODO: run only if gmmain.test_drawing succeeded.
if (kRaster_Backend == config.fBackend) {
- run_multiple_modes(gmmain, gm, config, gpuTarget, comparisonBitmap, tileGridReplayScales);
+ run_multiple_modes(gmmain, gm, config, comparisonBitmap, tileGridReplayScales);
}
if (FLAGS_deferred && errorsForThisConfig.isEmpty() &&
« no previous file with comments | « no previous file | src/core/SkLayerInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698