mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Stash enableCPUCores in CanvasContext
Avoids requring Device direction in Document. The method needs complete access to the Device object, though, so it's just another layer of indirection, with an extra reference on the Device object stashed in CanvasContext... (much like it already does for Screen)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
local Blitbuffer = require("ffi/blitbuffer")
|
||||
local CacheItem = require("cacheitem")
|
||||
local Configurable = require("configurable")
|
||||
local Device = require("device")
|
||||
local DocCache = require("document/doccache")
|
||||
local DrawContext = require("ffi/drawcontext")
|
||||
local CanvasContext = require("document/canvascontext")
|
||||
@@ -413,7 +412,7 @@ function Document:renderPage(pageno, rect, zoom, rotation, gamma, render_mode, h
|
||||
end
|
||||
|
||||
if hinting then
|
||||
Device:enableCPUCores(2)
|
||||
CanvasContext:enableCPUCores(2)
|
||||
end
|
||||
self:preRenderPage()
|
||||
|
||||
@@ -429,7 +428,7 @@ function Document:renderPage(pageno, rect, zoom, rotation, gamma, render_mode, h
|
||||
logger.warn("aborting, since we do not have a specification for that part")
|
||||
-- required part not given, so abort
|
||||
if hinting then
|
||||
Device:enableCPUCores(1)
|
||||
CanvasContext:enableCPUCores(1)
|
||||
end
|
||||
return
|
||||
end
|
||||
@@ -474,7 +473,7 @@ function Document:renderPage(pageno, rect, zoom, rotation, gamma, render_mode, h
|
||||
|
||||
self:postRenderPage()
|
||||
if hinting then
|
||||
Device:enableCPUCores(1)
|
||||
CanvasContext:enableCPUCores(1)
|
||||
end
|
||||
return tile
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user