<commit_before>local ffi = require("ffi")
local android = require("android")
local BB = require("ffi/blitbuffer")
local C = ffi.C

local has_eink_screen = android.isEink()
local full, partial, a2, auto = 1, 2, 3, 4 -- luacheck: ignore

local function update_eink(mode)
    if has_eink_screen then
	android.LOGV("requesting eink update " .. mode)
        android.einkUpdate(mode)
    end
end

local framebuffer = {}

function framebuffer:init()
    -- we present this buffer to the outside
    self.bb = BB.new(android.screen.width, android.screen.height, BB.TYPE_BBRGB32)
    self.invert_bb = BB.new(android.screen.width, android.screen.height, BB.TYPE_BBRGB32)
    -- TODO: should we better use these?
    -- android.lib.ANativeWindow_getWidth(window)
    -- android.lib.ANativeWindow_getHeight(window)
    self.bb:fill(BB.COLOR_WHITE)
    self:refreshFull()

    framebuffer.parent.init(self)
end

function framebuffer:_updateWindow()<commit_msg>[android - eink] do not refresh eink on framebuffer init (#842)<commit_after>local ffi = require("ffi")
local android = require("android")
local BB = require("ffi/blitbuffer")
local C = ffi.C

local has_eink_screen = android.isEink()
local full, partial, a2, auto = 1, 2, 3, 4 -- luacheck: ignore

local function update_eink(mode)
    if has_eink_screen then
	android.LOGV("requesting eink update " .. mode)
        android.einkUpdate(mode)
    end
end

local framebuffer = {}

function framebuffer:init()
    -- we present this buffer to the outside
    self.bb = BB.new(android.screen.width, android.screen.height, BB.TYPE_BBRGB32)
    self.invert_bb = BB.new(android.screen.width, android.screen.height, BB.TYPE_BBRGB32)
    -- TODO: should we better use these?
    -- android.lib.ANativeWindow_getWidth(window)
    -- android.lib.ANativeWindow_getHeight(window)
    self.bb:fill(BB.COLOR_WHITE)
    self:_updateWindow()

    framebuffer.parent.init(self)
end

function framebuffer:_updateWindow()
{'fraction_non_alphanumeric': 0.11601642710472279, 'fraction_numerical': 0.010780287474332649, 'mean_word_length': 4.075520833333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7219391', 'n_tokens_mistral': 661, 'n_tokens_neox': 645, 'n_words': 152}