Chromium Code Reviews| Index: ui/surface/transport_dib_android.cc |
| =================================================================== |
| --- ui/surface/transport_dib_android.cc (revision 188553) |
| +++ 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)) |
|
apatrick_chromium
2013/03/18 17:32:10
Do you want to evaluate VerifyCanvasSize(w, h) fir
jschuh
2013/03/21 01:08:03
No, because we won't get the actual size until we
|
| 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; |
| } |