344
344
Geometry base = GetGeometry();
346
346
graphics_engine.PushClippingRectangle(base);
347
GetPainter().PaintBackground(graphics_engine, base);
348
UXStyleImageRef ref_style = eIMAGE_STYLE_NONE;
349
350
if (visual_state_ == VISUAL_STATE_PRESSED)
351
GetPainter().PaintTextureShape(graphics_engine, base, eBUTTON_FOCUS);
352
ref_style = eBUTTON_FOCUS;
353
354
else if (visual_state_ == VISUAL_STATE_PRELIGHT)
355
GetPainter().PaintTextureShape(graphics_engine, base, eBUTTON_PRELIGHT);
356
ref_style = eBUTTON_PRELIGHT;
359
GetPainter().PaintTextureShape(graphics_engine, base, eBUTTON_NORMAL);
360
ref_style = eBUTTON_NORMAL;
363
const PainterImage *pimage = GetTheme().GetImage(ref_style);
364
BaseTexture* texture = NULL;
367
texture = pimage->texture;
370
TexCoordXForm texxform;
373
rop.SrcBlend = GL_ONE;
374
rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
376
GetPainter().PushDrawSliceScaledTextureLayer(graphics_engine, base, ref_style, color::White, eAllCorners, true, rop);
362
378
if (GetCompositionLayout())
368
384
clip_geo.OffsetSize(-left_clip_ - right_clip_, -top_clip_ - bottom_clip_);
370
386
graphics_engine.PushClippingRectangle(clip_geo);
371
GetPainter().PushPaintLayerStack();
372
GetCompositionLayout()->ProcessDraw(graphics_engine, force_draw);
373
GetPainter().PopPaintLayerStack();
388
GetCompositionLayout()->ProcessDraw(graphics_engine, true);
374
390
graphics_engine.PopClippingRectangle();
376
392
GetPainter().PopPaintLayerStack();
394
GetPainter().PopPaintLayer();
378
395
graphics_engine.PopClippingRectangle();