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

Unified Diff: src/core/SkPixmap.cpp

Issue 1776693002: Add deferred texture upload API. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase on sk_skp Created 4 years, 9 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 | « include/gpu/GrContext.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPixmap.cpp
diff --git a/src/core/SkPixmap.cpp b/src/core/SkPixmap.cpp
index 57bb194258d5f2bdc7b6eb1953c2108d565eaf2b..d7c4cffb7ecea0d6d25c3cec50b804f83e62c7f9 100644
--- a/src/core/SkPixmap.cpp
+++ b/src/core/SkPixmap.cpp
@@ -287,11 +287,19 @@ SkAutoPixmapStorage::~SkAutoPixmapStorage() {
this->freeStorage();
}
+size_t SkAutoPixmapStorage::AllocSize(const SkImageInfo& info, size_t* rowBytes) {
+ size_t rb = info.minRowBytes();
+ if (rowBytes) {
+ *rowBytes = rb;
+ }
+ return info.getSafeSize(rb);
+}
+
bool SkAutoPixmapStorage::tryAlloc(const SkImageInfo& info) {
this->freeStorage();
-
- size_t rb = info.minRowBytes();
- size_t size = info.getSafeSize(rb);
+
+ size_t rb;
+ size_t size = AllocSize(info, &rb);
if (0 == size) {
return false;
}
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698