mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 08:51:04 +02:00
gradient: try to fix delete gradient data only on color change
Signed-off-by: Thilo Graf <dbt@novatux.de>
Origin commit data
------------------
Commit: 53ce471af8
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2015-04-27 (Mon, 27 Apr 2015)
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "cc_base.h"
|
||||
#include <driver/screen_max.h>
|
||||
#include <system/debug.h>
|
||||
#include <cs_api.h>
|
||||
using namespace std;
|
||||
|
||||
// y
|
||||
@@ -98,8 +99,7 @@ void CComponentsItem::paintInit(bool do_save_bg)
|
||||
ix = cc_xr;
|
||||
iy = cc_yr;
|
||||
}
|
||||
|
||||
cc_gradientData.boxBuf = NULL;
|
||||
|
||||
cc_gradientData.mode = CFrameBuffer::pbrg_noFree;
|
||||
void* gradientData = (cc_gradientData.gradientBuf == NULL) ? NULL : &cc_gradientData;
|
||||
comp_fbdata_t fbdata[] =
|
||||
@@ -257,12 +257,21 @@ void CComponentsItem::setFocus(bool focus)
|
||||
|
||||
void CComponentsItem::initBodyGradient()
|
||||
{
|
||||
if (cc_body_gradientBuf == NULL) {
|
||||
if (col_body_gradient && cc_gradientData.gradientBuf && old_gradient_color != col_body) {
|
||||
free(cc_gradientData.gradientBuf);
|
||||
cc_gradientData.gradientBuf = NULL;
|
||||
if (cc_gradientData.boxBuf) {
|
||||
cs_free_uncached(cc_gradientData.boxBuf);
|
||||
cc_gradientData.boxBuf = NULL;
|
||||
}
|
||||
}
|
||||
if (cc_gradientData.gradientBuf == NULL) {
|
||||
CColorGradient ccGradient;
|
||||
int gsize = cc_body_gradient_direction == CFrameBuffer::gradientVertical ? height : width;
|
||||
cc_body_gradientBuf = ccGradient.gradientOneColor(col_body, NULL, gsize, cc_body_gradient_mode, cc_body_gradient_intensity, cc_body_gradient_intensity_v_min, cc_body_gradient_intensity_v_max, cc_body_gradient_saturation);
|
||||
cc_gradientData.gradientBuf = ccGradient.gradientOneColor(col_body, NULL, gsize, cc_body_gradient_mode, cc_body_gradient_intensity, cc_body_gradient_intensity_v_min, cc_body_gradient_intensity_v_max, cc_body_gradient_saturation);
|
||||
old_gradient_color = col_body;
|
||||
}
|
||||
cc_gradientData.gradientBuf = cc_body_gradientBuf;
|
||||
|
||||
cc_gradientData.direction = cc_body_gradient_direction;
|
||||
cc_gradientData.mode = CFrameBuffer::pbrg_noOption;
|
||||
}
|
||||
|
Reference in New Issue
Block a user