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

Unified Diff: cc/tiles/mipmap_util.h

Issue 2105903003: Remove error handling from MipmapUtil and add DCHECKs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fixdrt
Patch Set: rebase Created 4 years, 6 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 | cc/tiles/mipmap_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/mipmap_util.h
diff --git a/cc/tiles/mipmap_util.h b/cc/tiles/mipmap_util.h
index 521500ef1dee5a62a371da891641dddf98110e96..9aeeefa5bb3ed54724d6c9915180b938f769c5dd 100644
--- a/cc/tiles/mipmap_util.h
+++ b/cc/tiles/mipmap_util.h
@@ -16,25 +16,25 @@ class CC_EXPORT MipMapUtil {
// Determine the smallest mip level that is larger than |target_size|. Each
// mip level corresponds to a power of two scale of the image - for instance,
// level 0 is original size, level 1 is 2x smaller, level 2 is 4x smaller,
- // etc...
- // Returns -1 if |src_size| or |target_size| is invalid (any dimension is 0).
+ // etc... This function does not do error checking and must be called with a
+ // valid src_size (width/height > 0) and mip_level (>= 0).
static int GetLevelForSize(const gfx::Size& src_size,
const gfx::Size& target_size);
- // Determines the scale factor for the given |mip_level|. Returns (-1, -1) if
- // |src_size| is invalid (width/height <= 0), or if mip_level is invalid (==
- // -1).
+ // Determines the scale factor for the given |mip_level|. This function does
+ // not do error checking and must be called with a valid src_size
+ // (width/height > 0) and mip_level (>= 0).
static SkSize GetScaleAdjustmentForLevel(const gfx::Size& src_size,
int mip_level);
- // Determine the size of the given |mip_level|. Returns (-1, -1) if
- // |src_size| is invalid (width/height <= 0) or if mip-level is invalid (==
- // -1).
+ // Determine the size of the given |mip_level|. This function does not do
+ // error checking and must be called with a valid src_size (width/height > 0)
+ // and mip_level (>= 0).
static gfx::Size GetSizeForLevel(const gfx::Size& src_size, int mip_level);
// Determines the scale factor for the smallest mip level that is larger than
- // |target_size|. Returns (-1, -1) if |src_size| or |target_size| is invalid
- // (width/height <= 0).
+ // |target_size|. This function does not do error checking and must be called
+ // with a valid src_size (width/height > 0) and mip_level (>= 0).
static SkSize GetScaleAdjustmentForSize(const gfx::Size& src_size,
const gfx::Size& target_size);
};
« no previous file with comments | « no previous file | cc/tiles/mipmap_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698