MCPcopy Create free account
hub / github.com/XCSoar/XCSoar / LoadFile

Method LoadFile

src/ui/canvas/android/Bitmap.cpp:108–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108bool
109Bitmap::LoadFile(Path path)
110{
111 assert(path != nullptr && !path.empty());
112
113 Reset();
114
115 Java::LocalObject new_bmp;
116 bool flipped = false;
117 if (path.EndsWithIgnoreCase(".tif") || path.EndsWithIgnoreCase(".tiff")) {
118 new_bmp = native_view->LoadFileTiff(Java::GetEnv(), path);
119 flipped = true;
120 } else {
121 new_bmp = native_view->LoadFileBitmap(Java::GetEnv(), path);
122 }
123 if (new_bmp == nullptr)
124 return false;
125
126 return Set(Java::GetEnv(), new_bmp, Type::STANDARD, flipped);
127}

Callers

nothing calls this directly

Calls 6

ResetFunction · 0.85
LoadFileTiffMethod · 0.80
LoadFileBitmapMethod · 0.80
SetFunction · 0.50
emptyMethod · 0.45
EndsWithIgnoreCaseMethod · 0.45

Tested by

no test coverage detected