Skip to content

Commit

Permalink
move setupQuality to handlePaintEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Jun 16, 2013
1 parent 3fa2d77 commit d938cc5
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/Direct2DRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ void Direct2DRenderer::paintEvent(QPaintEvent *)
}
//http://www.daimakuai.net/?page_id=1574
d.render_target->BeginDraw();
d.setupQuality();
handlePaintEvent();
HRESULT hr = S_OK;
{
Expand Down
1 change: 0 additions & 1 deletion src/GDIRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ void GDIRenderer::drawFrame()
//steps to use BitBlt: http://bbs.csdn.net/topics/60183502
Bitmap bitmap(d.src_width, d.src_height, d.src_width*4*sizeof(char)
, PixelFormat32bppRGB, (BYTE*)d.data.data());
d.setupQuality();
#if USE_GRAPHICS
if (d.graphics)
d.graphics->DrawImage(&bitmap, d.out_rect.x(), d.out_rect.y(), d.out_rect.width(), d.out_rect.height());
Expand Down
1 change: 0 additions & 1 deletion src/GLWidgetRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ void GLWidgetRenderer::initializeGL()
void GLWidgetRenderer::paintGL()
{
//drawBackground(); //TODO: why this is always required? otherwise may flicker when aspect ratio changed(ubuntu 12.10)
d_func().setupQuality();
handlePaintEvent();
}

Expand Down
1 change: 0 additions & 1 deletion src/GraphicsItemRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ void GraphicsItemRenderer::paint(QPainter *painter, const QStyleOptionGraphicsIt
} else {
qWarning("FilterContext not available!");
}
d.setupQuality(); //move to handlePaintEvent
handlePaintEvent();
d.painter = 0; //painter may be not available outside this function
ctx->painter = 0;
Expand Down
1 change: 1 addition & 0 deletions src/QtAV/private/VideoRenderer_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class Q_EXPORT VideoRendererPrivate : public AVOutputPrivate
out_aspect_ratio = outAspectRatio;
qDebug("%f %dx%d <<<<<<<<", out_aspect_ratio, out_rect.width(), out_rect.height());
}
virtual void setupQuality() {}

//draw background when necessary, for example, renderer is resized. Then set to false
bool update_background;
Expand Down
1 change: 1 addition & 0 deletions src/VideoRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ void VideoRenderer::handlePaintEvent(QPaintEvent *event)
{
Q_UNUSED(event);
DPTR_D(VideoRenderer);
d.setupQuality();
//begin paint. how about QPainter::beginNativePainting()?
{
//lock is required only when drawing the frame
Expand Down
1 change: 0 additions & 1 deletion src/WidgetRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ void WidgetRenderer::paintEvent(QPaintEvent *e)
{
DPTR_D(WidgetRenderer);
d.painter->begin(this); //Widget painting can only begin as a result of a paintEvent
d.setupQuality();
handlePaintEvent(e);
//end paint. how about QPainter::endNativePainting()?
d.painter->end();
Expand Down

0 comments on commit d938cc5

Please sign in to comment.