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

Unified Diff: ui/surface/transport_dib_android.cc

Issue 12537014: Make SharedMemory track the size that was actually mapped (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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 | « ui/surface/transport_dib.cc ('k') | ui/surface/transport_dib_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/surface/transport_dib_android.cc
===================================================================
--- ui/surface/transport_dib_android.cc (revision 190994)
+++ ui/surface/transport_dib_android.cc (working copy)
@@ -63,7 +63,7 @@
}
skia::PlatformCanvas* TransportDIB::GetPlatformCanvas(int w, int h) {
- if (!memory() && !Map())
+ if ((!memory() && !Map()) || !VerifyCanvasSize(w, h))
return NULL;
return skia::CreatePlatformCanvas(w, h, true,
reinterpret_cast<uint8_t*>(memory()),
@@ -71,15 +71,10 @@
}
bool TransportDIB::Map() {
- if (!is_valid_handle(handle()))
+ if (!is_valid_handle(handle()) || !shared_memory_.Map(0))
return false;
- // We will use ashmem_get_size_region() to figure out the size in Map(size).
- if (!shared_memory_.Map(0))
- return false;
- // TODO: Note that using created_size() below is a hack. See the comment in
- // SharedMemory::Map().
- size_ = shared_memory_.created_size();
+ size_ = shared_memory_.mapped_size();
return true;
}
« no previous file with comments | « ui/surface/transport_dib.cc ('k') | ui/surface/transport_dib_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698