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

Unified Diff: skia/ext/image_operations.cc

Issue 2921533006: Fix a DCHECK ordering problem in ImageOperations. (Closed)
Patch Set: Created 3 years, 7 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/image_operations.cc
diff --git a/skia/ext/image_operations.cc b/skia/ext/image_operations.cc
index 8b5f371d33fb8f64690d0002b9c3a47ce7f26d03..5a3c2f4931506743be9c0c16620ff12f484a0254 100644
--- a/skia/ext/image_operations.cc
+++ b/skia/ext/image_operations.cc
@@ -345,16 +345,16 @@ SkBitmap ImageOperations::Resize(const SkBitmap& source,
// Time how long this takes to see if it's a problem for users.
base::TimeTicks resize_start = base::TimeTicks::Now();
- SkIRect dest = { 0, 0, dest_width, dest_height };
- DCHECK(dest.contains(dest_subset)) <<
- "The supplied subset does not fall within the destination image.";
-
// If the size of source or destination is 0, i.e. 0x0, 0xN or Nx0, just
// return empty.
if (source.width() < 1 || source.height() < 1 ||
dest_width < 1 || dest_height < 1)
return SkBitmap();
+ SkIRect dest = {0, 0, dest_width, dest_height};
+ DCHECK(dest.contains(dest_subset))
+ << "The supplied subset does not fall within the destination image.";
+
method = ResizeMethodToAlgorithmMethod(method);
// Check that we deal with an "algorithm methods" from this point onward.
SkASSERT((ImageOperations::RESIZE_FIRST_ALGORITHM_METHOD <= method) &&
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698