Example #1
0
void RWsTextCursor::Draw(CFbsBitGc* aGc, const TRegion& aRegion)
	{
	iDrawRegion.Copy(iWin->VisibleRegion());
	if (iFlags&ETextCursorFlagClipped)
		{
		TRect rect(iClipRect);
		rect.Move(iWin->Origin());
		iDrawRegion.ClipRect(rect);
		}

	// Need to clip against a possible recent screen size change.
	iDrawRegion.ClipRect(iWin->Screen()->DrawDevice()->SizeInPixels());


	RWsRegion tmpRegion;
	tmpRegion.Intersection(iDrawRegion, aRegion);
	if (tmpRegion.CheckError())
		doDraw(aGc, iDrawRegion);
	else
		{
		if (!tmpRegion.IsEmpty())
			{
			doDraw(aGc, tmpRegion);
			}
		}
	tmpRegion.Close();
	}
Example #2
0
void ScalableFont::draw(const core::stringw& text,
    const core::rect<s32>& position, video::SColor color,
    bool hcenter, bool vcenter,
    const core::rect<s32>* clip)
{
    doDraw(text, position, color, hcenter, vcenter, clip, NULL);
}
Example #3
0
    void onDrawContent(SkCanvas* canvas) override {
        GraphicsPort skp(canvas);
        doDraw(&skp);

        const SkImageInfo info = SkImageInfo::MakeN32Premul(256, 256);
        std::unique_ptr<SkCanvas> c2 =
            SkRasterHandleAllocator::MakeCanvas(skstd::make_unique<MyAllocator>(), info);
        MyPort cgp(c2.get());
        doDraw(&cgp);

        SkPixmap pm;
        c2->peekPixels(&pm);
        SkBitmap bm;
        bm.installPixels(pm);
        canvas->drawBitmap(bm, 280, 0, nullptr);
    }
Example #4
0
void Element::draw (void) {
    if (bDraw) {
        glColor3f (red, green, blue);
        glPushMatrix ();
        doDraw ();
        glPopMatrix ();
    }
}
void LLPanelPathfindingRebakeNavmesh::draw()
{
	if (doDraw())
	{
		updatePosition();
		LLPanel::draw();
	}
}
Example #6
0
void Context::draw(HDC hdc) {
	HGLRC oldctx = owglGetCurrentContext();
	HDC oldhdc = owglGetCurrentDC();
	owglMakeCurrent(hdc, ctx);

	doDraw(hdc);

	owglMakeCurrent(oldhdc, oldctx);
}
Example #7
0
    void onDraw(SkCanvas* canvas) override {
        if (false) { test_stroke(canvas); return; }

        SkPaint paint;
        paint.setAntiAlias(true);
        paint.setTypeface(fEmFace);
        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
        paint.setStrokeWidth(SkIntToScalar(4));
        paint.setTextSize(SkIntToScalar(40));
        paint.setTextAlign(SkPaint::kCenter_Align);

        canvas->save();
        canvas->translate(SkIntToScalar(10), SkIntToScalar(10));
        // translate (1 point)
        const int src1[] = { 0, 0 };
        const int dst1[] = { 5, 5 };
        doDraw(canvas, &paint, src1, dst1, 1);
        canvas->restore();

        canvas->save();
        canvas->translate(SkIntToScalar(160), SkIntToScalar(10));
        // rotate/uniform-scale (2 points)
        const int src2[] = { 32, 32, 64, 32 };
        const int dst2[] = { 32, 32, 64, 48 };
        doDraw(canvas, &paint, src2, dst2, 2);
        canvas->restore();

        canvas->save();
        canvas->translate(SkIntToScalar(10), SkIntToScalar(110));
        // rotate/skew (3 points)
        const int src3[] = { 0, 0, 64, 0, 0, 64 };
        const int dst3[] = { 0, 0, 96, 0, 24, 64 };
        doDraw(canvas, &paint, src3, dst3, 3);
        canvas->restore();

        canvas->save();
        canvas->translate(SkIntToScalar(160), SkIntToScalar(110));
        // perspective (4 points)
        const int src4[] = { 0, 0, 64, 0, 64, 64, 0, 64 };
        const int dst4[] = { 0, 0, 96, 0, 64, 96, 0, 64 };
        doDraw(canvas, &paint, src4, dst4, 4);
        canvas->restore();
    }
Example #8
0
    virtual void onDraw(SkCanvas* canvas) {
        this->drawBG(canvas);
        
        SkPaint paint;
        paint.setAntiAlias(true);
        paint.setStrokeWidth(SkIntToScalar(4));
        paint.setTextSize(SkIntToScalar(40));
        paint.setTextAlign(SkPaint::kCenter_Align);

        canvas->save();
        canvas->translate(SkIntToScalar(10), SkIntToScalar(10));
        // translate (1 point)
        const int src1[] = { 0, 0 };
        const int dst1[] = { 5, 5 };
        doDraw(canvas, &paint, src1, dst1, 1);
        canvas->restore();
        
        canvas->save();
        canvas->translate(SkIntToScalar(160), SkIntToScalar(10));
        // rotate/uniform-scale (2 points)
        const int src2[] = { 32, 32, 64, 32 };
        const int dst2[] = { 32, 32, 64, 48 };
        doDraw(canvas, &paint, src2, dst2, 2);
        canvas->restore();
        
        canvas->save();
        canvas->translate(SkIntToScalar(10), SkIntToScalar(110));
        // rotate/skew (3 points)
        const int src3[] = { 0, 0, 64, 0, 0, 64 };
        const int dst3[] = { 0, 0, 96, 0, 24, 64 };
        doDraw(canvas, &paint, src3, dst3, 3);
        canvas->restore();
        
        canvas->save();
        canvas->translate(SkIntToScalar(160), SkIntToScalar(110));
        // perspective (4 points)
        const int src4[] = { 0, 0, 64, 0, 64, 64, 0, 64 };
        const int dst4[] = { 0, 0, 96, 0, 64, 96, 0, 64 };
        doDraw(canvas, &paint, src4, dst4, 4);
        canvas->restore();
    }
Example #9
0
void TFileList::doOnChangeDir ()
{
  char tmp[80], *dir;
  my_getcwd (tmp, 80);    // Guardar el path actual.
  dir = getabsolute ();   // Tomar el nombre como absoluto al path
  if (chdir (dir)==0) {   // intentar cambiar el directorio.
    my_getcwd (path, 80); // si se pudo, era directorio, reescanearlo.
    chdir (tmp);
    scandir ();
    doDraw ();
  }
}
Example #10
0
void botmove(){
	addressCard C = whichcardtake();
	if(C != NULL){
		doTake(Card(C));		
		doMeld(Card(C));
	}else{
		doDraw();
	}
	botmeld();
	infoCard off = whichcardoff();
	doOff(off);
}
Example #11
0
void ScalableFont::draw(const core::stringw& text,
                        const core::rect<s32>& position, video::SColor color,
                        bool hcenter, bool vcenter,
                        const core::rect<s32>* clip, bool ignoreRTL)
{
    bool previousRTL = m_rtl;
    if (ignoreRTL) m_rtl = false;

    doDraw(text, position, color, hcenter, vcenter, clip, NULL);

    if (ignoreRTL) m_rtl = previousRTL;
}
Example #12
0
void DesktopWindow::onPaint(DeviceContext *dc, PAINTSTRUCT *paintStruct)
{
  AutoLock al(&m_bufferLock);
  Rect paintRect(&paintStruct->rcPaint);

  if (paintRect.area() != 0) {
    try {
      m_framebuffer.setTargetDC(paintStruct->hdc);
      if (!m_clientArea.isEmpty()) {
        doDraw(dc);
      }
    } catch (Exception &ex) {
      m_logWriter->error(_T("Error in onPaint: %s"), ex.getMessage());
    }
  }
}
    void Paint() {
        if (!fImage.is_null()) {
            SkPaint paint;
            paint.setAntiAlias(true);
            paint.setTextSize(SkIntToScalar(30));
            paint.setTextAlign(SkPaint::kCenter_Align);
            doDraw(fCanvas, paint, "Hello");

            fDeviceContext.PaintImageData(fImage, pp::Point(0, 0));
            if (!fFlushPending) {
                fFlushPending = true;
                fDeviceContext.Flush(pp::CompletionCallback(&FlushCallback, this));
            } else {
                SkDebugf("A flush is pending... Skipping flush.\n");
            }
        } else {
            SkDebugf("No pixels to write to!\n");
        }
    }
Example #14
0
// New doMyDeviceLoop, now works with multiple monitors
void doMyDeviceLoop()
{
	int				depth;
	Rect			gDeviceRect;
	Rect			intersectingRect;
	GDHandle		gDevice;
	//WindowRecord	*windowRec = (WindowRecord *)gWindow;
	WindowPtr		windowRec = gWindow;
	Rect			windowRect; //= (**windowRec->contRgn).rgnBBox;
	RgnHandle		rgnHandle = NewRgn();
	
	GetWindowRegion(windowRec, kWindowContentRgn, rgnHandle);
	GetRegionBounds(rgnHandle, &windowRect);

	// Get the handle to the first device in the list. 
	gDevice = GetDeviceList();

	// Loop through all the devices in the list. 
	while (gDevice != nil)
	{
		// Get the device's gdRect  */
		gDeviceRect = (**gDevice).gdRect;
		depth = (**(**gDevice).gdPMap).pixelSize;

		// Check if the app's window rect intersects the device's, and if it 
		// does, set the clip region's rect to the intersection, then DRAW! 
		if (SectRect( &windowRect, &gDeviceRect, &intersectingRect ))
		{
			// The intersectingRect is in global coords. Convert to local 
			GlobalToLocal((Point *)&intersectingRect.top);
			GlobalToLocal((Point *)&intersectingRect.bottom);

			ClipRect( &intersectingRect );
			doDraw( depth, &intersectingRect );
		}

		// Get the next device in the list. 
		gDevice = GetNextDevice( gDevice );
	}
	
	DisposeRgn(rgnHandle);
}
Example #15
0
void CBaseSprite::draw()
{
	if (mEnabled) doDraw();
}
Example #16
0
DendroColorPoint DendrogramPanel::doDraw(wxDC &dc, int node_idx, int y)
{
    
    wxSize sz = this->GetClientSize();
    double hh = sz.y;
    double ww = sz.x;
    
    if (node_idx >= 0) {
        int x = ww - margin - 30;

        wxColour clr =  color_vec[clusters[node_idx] -1];
        RectNode* end = new RectNode(node_idx, x, currentY, clr);
        end->draw(dc);
        end_nodes.push_back(end);
        
        int resultX = x;
        int resultY = currentY;
        
        currentY += heightPerLeaf;
        
        wxPoint pt(resultX, resultY);
        return DendroColorPoint(pt, clr);
    }
    
    if (accessed_node.find(node_idx) != accessed_node.end()) {
        // loop!!!
        return DendroColorPoint();
    }
    accessed_node[node_idx] = 1;
    
    DendroColorPoint cp0 = doDraw(dc, root[-node_idx -1].left, y);
    DendroColorPoint cp1 = doDraw(dc, root[-node_idx -1].right, y+heightPerLeaf);
    
    wxPoint p0 = cp0.pt;
    wxColour c0 = cp0.color;
    
    wxPoint p1 = cp1.pt;
    wxColour c1 = cp1.color;
    
    //dc.DrawRectangle(wxRect(p0.x-2, p0.y-2, 4, 4));
    //dc.DrawRectangle(wxRect(p1.x-2, p1.y-2, 4, 4));
    
    double dist = level_node[node_idx];
    int vx = ww - margin - 30 - (ww - 2*margin - 30) * dist / maxDistance ;
    
    wxPen pen0(c0);
    dc.SetPen(pen0);
    dc.DrawLine(vx, p0.y, p0.x, p0.y);
    
    wxPen pen1(c1);
    dc.SetPen(pen1);
    dc.DrawLine(vx, p1.y, p1.x, p1.y);
    
    if (c0 == c1) {
        dc.DrawLine(vx, p0.y, vx, p1.y);
    } else {
        dc.SetPen(*wxBLACK_PEN);
        dc.DrawLine(vx, p0.y, vx, p1.y);
    }
    dc.SetPen(*wxBLACK_PEN);
    
    wxPoint p(vx, p0.y+(p1.y - p0.y)/2);
    
    if (c0 == c1) {
        return DendroColorPoint(p, c0);
    } else {
        return DendroColorPoint(p, *wxBLACK);
    }
}
Example #17
0
void GraphicsComponent::drawPixel(int x, int y)
{
  vec<int> pixelCoords = drawer->pixel2Pixel(x, y);
  doDraw(pixelCoords.x, pixelCoords.y);
}
Example #18
0
void DendrogramPanel::init() {
    
    isLayerValid = false;
    
    wxSize sz = this->GetClientSize();
    double hh = sz.y;
    double ww = sz.x;
    
    for (int i=0; i<end_nodes.size(); i++) {
        delete end_nodes[i];
    }
    end_nodes.clear();
    
    
    if (layer_bm == NULL) {
        double scale_factor = GetContentScaleFactor();
        layer_bm = new wxBitmap;
        layer_bm->CreateScaled(ww, hh, 32, scale_factor);
    }
    
    margin = 10.0;
    
    heightPerLeaf = (hh - margin - margin) / (double)leaves;
    widthPerLevel = (ww - margin - margin)/ (double)levels;
    
    currentY = 10;
    
    wxMemoryDC dc;
    dc.SelectObject(*layer_bm);
    dc.Clear();
    dc.SetFont(*GdaConst::extra_small_font);
    
    int start_y = 0;
    accessed_node.clear();
    
    
    bool draw_node = nelements < 10000;
    if (draw_node) {
        doDraw(dc, -(nelements-2) - 1, start_y);
    } else {
        wxString nodraw_msg = _("(Dendrogram is too complex to draw. Please view clustering results in map.)");
        dc.DrawText(nodraw_msg, 20, 20);
    }

    // draw verticle line
    if (!isMovingSplitLine) {
        int v_start =  ww - margin - 30 - (ww - 2*margin - 30) * cutoffDistance / maxDistance;
        wxPoint v_p0(v_start, 0);
        wxPoint v_p1(v_start, hh);
        if (split_line == NULL) {
            split_line = new DendroSplitLine(v_p0, v_p1);
        } else {
            split_line->update(v_p0, v_p1);
        }
    }
    
    
    dc.SelectObject(wxNullBitmap);
    
    isLayerValid = true;
    Refresh();
}
Example #19
0
	inline void On () { ison=true; doDraw(); }
 void draw(Shapecolor color = Red)
 {
     doDraw(color);
 }
Example #21
0
//备注:支持3层modify:
//		第1层是CAni自身配置的Moidfy.
//		第2层是CAniCombo配置的Moidfy(仅 @offset @delay @scale),即组合过程中的Modify
//		第3层是组合完成后整个组合特效的Modify.
void DrawAni::draw(const AniModify* mod_lev2, const AniModify* mod_lev3)
{
	if (!m_pkAni || m_pkAni->getFrameCount() == 0 || !m_pkInstance
		|| !m_pkInstance->getOwnerNode())
		return;

	// apply mod: delay
	m_kTick.setDelay(m_pkAni->m_kAniModifyEx.getDelay() + (mod_lev2 ? mod_lev2->getDelay() : 0)
		//+ (mod_lev3 ? mod_lev3->getDelay() : 0 )	//最外层delay此处无效,仅在外层起作用!
		);

	// tick state until playing
	m_kTick.tickState();
	if (!m_kTick.isPlaying())
		return;

	// calc frame xx
	float deltaTime = m_kTick.deltaTime(); //已播放时间
	int frameCount = SafeDivide<float>(deltaTime, m_pkAni->getTimeInterval()); //已播放帧数
	int loopCount = SafeDivide<int>(frameCount, m_pkAni->getFrameCount()); //已播放次数
	int frameIndex = frameCount % m_pkAni->getFrameCount(); //当前播放帧索引

	// ------------------------- need draw ? --------------------------
	bool bNeedDraw = false;
	if (m_pkAni->m_kAniModifyEx.isModeLoop())
	{
		bNeedDraw = true;
	}
	else if (m_pkAni->m_kAniModifyEx.isModeLoopCount())
	{
		bNeedDraw = (loopCount < m_pkAni->m_kAniModifyEx.getLoopCount());
	}
	else if (m_pkAni->m_kAniModifyEx.isModeLoopTime())
	{
		bNeedDraw = (deltaTime < m_pkAni->m_kAniModifyEx.getLoopTime());
	}
	else if (m_pkAni->m_kAniModifyEx.isModeOnce())
	{
		//needDraw = (frameCount < ani->getFrameCount());
		bNeedDraw = (m_kTick.deltaTime() < m_pkAni->getPlayOnceTime());

		// stay at last frame when ani finished
		if (!bNeedDraw && m_pkAni->m_kAniModifyEx.getStay())
		{
			if (m_pkAni->m_kAniModifyEx.isStayForEver()
				|| m_kTick.deltaTime()
				< m_pkAni->getPlayOnceTime() + m_pkAni->m_kAniModifyEx.getStayTime())
			{
				bNeedDraw = true;
				frameIndex = m_pkAni->getFrameCount() - 1;
			}
		}
	}

	// -------------------------- draw it -----------------------------
	if (!bNeedDraw)
	{
		// will be removed in next tick.
		m_kTick.setFinished();
	}
	else
	{
		doDraw(frameIndex, mod_lev2, mod_lev3);
	}
}
Example #22
0
	inline void Toggle () { ison=(bool)!ison; doDraw(); }
Example #23
0
void GraphicsComponent::drawWorld(float x, float y)
{
  vec<int> pixelCoords = drawer->world2Pixel(x, y);
  doDraw(pixelCoords.x, pixelCoords.y);
}
Example #24
0
	void do_draw_flags( int f) {
	  int t=dflags;
	  dflags = f;
	  doDraw();
	  dflags = t;
	}
Example #25
0
void CSpotLight::draw()
{
	if (mEnabled) doDraw();
}
Example #26
0
JNIEXPORT void JNICALL Java_com_tetrark_ganesh_MyRenderer_nativeDrawFrame(JNIEnv*, jobject) {
    doDraw();
}
Example #27
0
	inline void Off () { ison=false; doDraw(); }
Example #28
0
void Ability::draw(sf::RenderTarget& target, sf::RenderStates states) const {
	if (mIsActive) {
		doDraw(target, states);
	}
}