MCPcopy Create free account
hub / github.com/Tencent/libpag / present

Method present

src/rendering/drawables/BitmapDrawable.cpp:50–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50void BitmapDrawable::present(tgfx::Context* context) {
51 if (bitmap == nullptr) {
52 return;
53 }
54 auto hardwareBuffer = bitmap->getHardwareBuffer();
55 if (hardwareBuffer != nullptr) {
56 context->submit(true);
57 pixelCopied = true;
58 return;
59 }
60 if (offscreenSurface != nullptr) {
61 auto pixels = bitmap->lockPixels();
62 if (pixels == nullptr) {
63 return;
64 }
65 pixelCopied = offscreenSurface->readPixels(bitmap->info(), pixels);
66 bitmap->unlockPixels();
67 }
68}
69
70std::shared_ptr<tgfx::Surface> BitmapDrawable::onCreateSurface(tgfx::Context* context) {
71 if (bitmap == nullptr) {

Callers

nothing calls this directly

Calls 6

submitMethod · 0.80
lockPixelsMethod · 0.80
infoMethod · 0.80
unlockPixelsMethod · 0.80
getHardwareBufferMethod · 0.45
readPixelsMethod · 0.45

Tested by

no test coverage detected