void window::refresh_slot_by_ref(ref& ref, bool draw_all) { agg::trans_affine mtx(ref.matrix); this->scale(mtx); opt_rect<double> rect; if (!ref.valid_rect || draw_all) rect.set(rect_of_slot_matrix<double>(mtx)); AGG_LOCK(); opt_rect<double> draw_rect; ref.plot->draw_queue(*m_canvas, mtx, ref.inf, draw_rect); rect.add<rect_union>(draw_rect); rect.add<rect_union>(ref.dirty_rect); ref.dirty_rect = draw_rect; AGG_UNLOCK(); if (rect.is_defined()) { const int m = 4; const agg::rect_base<double>& r = rect.rect(); const agg::rect_base<int> ri(r.x1 - m, r.y1 - m, r.x2 + m, r.y2 + m); update_region (ri); } }
int set_i18n(const char *domainname, const char *dirname) { _retv_if(_set, 0); update_lang(); update_region(); return __set_i18n(domainname, dirname); }
EXPORT_API int appcore_set_i18n(const char *domainname, const char *dirname) { int r; update_lang(); update_region(); r = __set_i18n(domainname, dirname); if (r == 0) _set = 1; return r; }
LRESULT window_win32::proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { LRESULT ret = 0; switch(msg) { case WM_CREATE: debug_log("treating WM_CREATE event"); break; case WM_SIZE: { const unsigned width = LOWORD(lParam), height = HIWORD(lParam); debug_log("treating WM_SIZE event width: %d height: %d", width, height); m_target.resize(width, height); m_target.render(); break; } case WM_ERASEBKGND: break; case WM_PAINT: { debug_log("treating WM_PAINT event"); PAINTSTRUCT ps; HDC paintDC = ::BeginPaint(hWnd, &ps); m_target.draw(); ::EndPaint(hWnd, &ps); m_window_status.set(graphics::window_running); break; } case WM_COMMAND: break; case WM_DESTROY: ::PostQuitMessage(0); break; case WM_LIBCANVAS_UPD_REGION: if (m_update_region.img) { update_region(*m_update_region.img, m_update_region.r); } break; default: ret = ::DefWindowProc(hWnd, msg, wParam, lParam); break; } return ret; }
void window::draw_slot_by_ref(window::ref& ref, bool draw_image) { agg::trans_affine mtx(ref.matrix); this->scale(mtx); agg::rect_base<int> r = rect_of_slot_matrix<int>(mtx); m_canvas->clear_box(r); if (ref.plot) { AGG_LOCK(); ref.plot->draw(*m_canvas, mtx, &ref.inf); AGG_UNLOCK(); } if (draw_image) update_region(r); }
static void repaint_stack( CoreWindowStack *stack, DFBRegion *region, DFBSurfaceFlipFlags flags ) { DisplayLayer *layer = dfb_layer_at( stack->layer_id ); CoreSurface *surface = dfb_layer_surface( layer ); CardState *state = dfb_layer_state( layer ); if (!dfb_region_intersect( region, 0, 0, surface->width - 1, surface->height - 1 )) return; if (dfb_layer_lease( layer )) return; state->clip = *region; state->modified |= SMF_CLIP; update_region( stack, state, stack->num_windows - 1, region->x1, region->y1, region->x2, region->y2 ); if (surface->caps & DSCAPS_FLIPPING) { if (region->x1 == 0 && region->y1 == 0 && region->x2 == surface->width - 1 && region->y2 == surface->height - 1 && 0) { dfb_layer_flip_buffers( layer, flags ); } else { DFBRectangle rect = { region->x1, region->y1, region->x2 - region->x1 + 1, region->y2 - region->y1 + 1 }; if (flags & DSFLIP_WAITFORSYNC) dfb_fbdev_wait_vsync(); dfb_back_to_front_copy( surface, &rect ); } } dfb_layer_release( layer, false ); }
/* * Called when a TA is invoked. sess_ctx hold that value that was * assigned by TA_OpenSessionEntryPoint(). The rest of the paramters * comes from normal world. */ TEE_Result TA_InvokeCommandEntryPoint(void *sess_ctx, uint32_t cmd_id, uint32_t param_types, TEE_Param params[4]) { (void)&sess_ctx; /* Unused parameter */ switch (cmd_id) { case TA_SDP_CREATE_REGION: return create_region(param_types, params); case TA_SDP_DESTROY_REGION: return destroy_region(param_types, params); case TA_SDP_UPDATE_REGION: return update_region(param_types, params); case TA_SDP_DUMP_STATUS: return dump_status(param_types, params); default: return TEE_ERROR_BAD_PARAMETERS; } }
static int __sys_regionchg_pre(void *data, void *evt) { update_region(); return 0; }
void board_t::update_regions() { for(auto i = 0; i < cells_.size(); ++i) { auto c = cells_[i].get(); update_region(c); } }
static void update_region( CoreWindowStack *stack, CardState *state, int start, int x1, int y1, int x2, int y2 ) { int i = start; DFBRegion region = { x1, y1, x2, y2 }; /* check for empty region */ DFB_ASSERT (x1 <= x2 && y1 <= y2); while (i >= 0) { if (VISIBLE_WINDOW(stack->windows[i])) { int wx2 = stack->windows[i]->x + stack->windows[i]->width - 1; int wy2 = stack->windows[i]->y + stack->windows[i]->height - 1; if (dfb_region_intersect( ®ion, stack->windows[i]->x, stack->windows[i]->y, wx2, wy2 )) break; } i--; } if (i >= 0) { if (TRANSLUCENT_WINDOW(stack->windows[i])) update_region( stack, state, i-1, x1, y1, x2, y2 ); else { /* left */ if (region.x1 != x1) update_region( stack, state, i-1, x1, region.y1, region.x1-1, region.y2 ); /* upper */ if (region.y1 != y1) update_region( stack, state, i-1, x1, y1, x2, region.y1-1 ); /* right */ if (region.x2 != x2) update_region( stack, state, i-1, region.x2+1, region.y1, x2, region.y2 ); /* lower */ if (region.y2 != y2) update_region( stack, state, i-1, x1, region.y2+1, x2, y2 ); } { CoreWindow *window = stack->windows[i]; DFBSurfaceBlittingFlags flags = DSBLIT_NOFX; DFBRectangle srect = { region.x1 - window->x, region.y1 - window->y, region.x2 - region.x1 + 1, region.y2 - region.y1 + 1 }; if (window->options & DWOP_ALPHACHANNEL) flags |= DSBLIT_BLEND_ALPHACHANNEL; if (window->opacity != 0xFF) { flags |= DSBLIT_BLEND_COLORALPHA; if (state->color.a != window->opacity) { state->color.a = window->opacity; state->modified |= SMF_COLOR; } } if (window->options & DWOP_COLORKEYING) { flags |= DSBLIT_SRC_COLORKEY; if (state->src_colorkey != window->color_key) { state->src_colorkey = window->color_key; state->modified |= SMF_SRC_COLORKEY; } } if (state->blittingflags != flags) { state->blittingflags = flags; state->modified |= SMF_BLITTING_FLAGS; } state->source = window->surface; state->modified |= SMF_SOURCE; dfb_gfxcard_blit( &srect, region.x1, region.y1, state ); state->source = NULL; } } else { switch (stack->bg.mode) { case DLBM_COLOR: { DFBRectangle rect = { x1, y1, x2 - x1 + 1, y2 - y1 + 1 }; state->color = stack->bg.color; state->modified |= SMF_COLOR; dfb_gfxcard_fillrectangle( &rect, state ); break; } case DLBM_IMAGE: { DFBRectangle rect = { x1, y1, x2 - x1 + 1, y2 - y1 + 1 }; if (state->blittingflags != DSBLIT_NOFX) { state->blittingflags = DSBLIT_NOFX; state->modified |= SMF_BLITTING_FLAGS; } state->source = stack->bg.image; state->modified |= SMF_SOURCE; dfb_gfxcard_blit( &rect, x1, y1, state ); state->source = NULL; break; } case DLBM_TILE: { DFBRectangle rect = { 0, 0, stack->bg.image->width, stack->bg.image->height }; if (state->blittingflags != DSBLIT_NOFX) { state->blittingflags = DSBLIT_NOFX; state->modified |= SMF_BLITTING_FLAGS; } state->source = stack->bg.image; state->modified |= SMF_SOURCE; dfb_gfxcard_tileblit( &rect, (x1 / rect.w) * rect.w, (y1 / rect.h) * rect.h, (x2 / rect.w + 1) * rect.w, (y2 / rect.h + 1) * rect.h, state ); state->source = NULL; break; } default: ; } } }