[apps/shared/round_cursor_view] Fix GRAPH_CURSOR_SPEEDUP macro usage

This commit is contained in:
Ruben Dashyan
2020-01-31 11:56:38 +01:00
committed by Léa Saviot
parent 9d1a5ea0a8
commit 503a9ed128
2 changed files with 15 additions and 4 deletions

View File

@@ -6,8 +6,10 @@ static KDColor s_cursorWorkingBuffer[Dots::LargeDotDiameter*Dots::LargeDotDiamet
void RoundCursorView::drawRect(KDContext * ctx, KDRect rect) const {
KDRect r = bounds();
#ifdef GRAPH_CURSOR_SPEEDUP
ctx->getPixels(r, m_underneathPixelBuffer);
m_underneathPixelBufferLoaded = true;
#endif
ctx->blendRectWithMask(r, m_color, (const uint8_t *)Dots::LargeDotMask, s_cursorWorkingBuffer);
}
@@ -17,12 +19,14 @@ KDSize RoundCursorView::minimalSizeForOptimalDisplay() const {
void RoundCursorView::setColor(KDColor color) {
m_color = color;
#ifdef GRAPH_CURSOR_SPEEDUP
eraseCursorIfPossible();
#endif
markRectAsDirty(bounds());
}
void RoundCursorView::setCursorFrame(KDRect f, bool force) {
#if GRAPH_CURSOR_SPEEDUP
#ifdef GRAPH_CURSOR_SPEEDUP
/* TODO This is quite dirty (we are out of the dirty tracking and we assume
* the cursor is the upmost view) but it works well. */
if (m_frame == f && !force) {