From fbb4353a247157d32208f8f133cd1ee42f4fbc49 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Mon, 28 Dec 2015 21:54:50 +0100 Subject: Update minuitwrp graphics in line with latest minui Note: events.cpp is still old code renamed to cpp to make it easier to call functions like gr_fb_width(). I had to modify AOSP fbdev code to provide a separate memory surface for drawing to as drawing directly to the framebuffer resulted in rendering taking about 5 times longer. I also modified AOSP adf code to provide a separate memory surface for drawing for the same performance reasons. The Nexus 9 supports adf graphics. Overlay graphics work on at least one device. Overlay provides a separate memory buffer already so performance is good. I do not have a drm device yet that I know of. I made some attempt to update the drm code to determine the correct pixel format based on the drm graphics format, but what is available in pixel flinger and what is available in drm do not line up all that well. Reports are that the Pixel C is using drm graphics, but performance is slow, likely due to the use of a mmap instead of a memory buffyer. Change-Id: Ibd45bccca6ac2cb826037aa9b2aa5065cf683eed --- gui/keyboard.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gui/keyboard.cpp') diff --git a/gui/keyboard.cpp b/gui/keyboard.cpp index 3b8fdc9ae..4a78ad798 100644 --- a/gui/keyboard.cpp +++ b/gui/keyboard.cpp @@ -25,9 +25,9 @@ extern "C" { #include "../twcommon.h" -#include "../minuitwrp/minui.h" #include "gui.h" } +#include "../minuitwrp/minui.h" #include "rapidxml.hpp" #include "objects.hpp" @@ -333,7 +333,7 @@ void GUIKeyboard::DrawKey(Key& key, int keyX, int keyY, int keyW, int keyH) else if (!labelText.empty()) { void* fontResource = labelFont->GetResource(); - int textW = gr_measureEx(labelText.c_str(), fontResource); + int textW = gr_ttf_measureEx(labelText.c_str(), fontResource); int textH = labelFont->GetHeight(); int textX = keyX + (keyW - textW) / 2; int textY = keyY + (keyH - textH) / 2; @@ -347,7 +347,7 @@ void GUIKeyboard::DrawKey(Key& key, int keyX, int keyY, int keyW, int keyH) gr_color(mLongpressFontColor.red, mLongpressFontColor.green, mLongpressFontColor.blue, mLongpressFontColor.alpha); string text(1, keychar); int textH = mLongpressFont->GetHeight(); - int textW = gr_measureEx(text.c_str(), fontResource); + int textW = gr_ttf_measureEx(text.c_str(), fontResource); int textX = keyX + keyW - longpressOffsetX - textW; int textY = keyY + longpressOffsetY; gr_textEx_scaleW(textX, textY, text.c_str(), fontResource, keyW, TOP_LEFT, 0); -- cgit v1.2.3