Mercurial > hg > svgui
comparison view/View.cpp @ 1603:f12c25651f96
Debug
author | Chris Cannam |
---|---|
date | Wed, 29 Apr 2020 17:47:37 +0100 |
parents | 27f3e64489e1 |
children | ae2d5f8ff005 |
comparison
equal
deleted
inserted
replaced
1602:a798a7b5e215 | 1603:f12c25651f96 |
---|---|
3001 | 3001 |
3002 sv_frame_t origCentreFrame = m_centreFrame; | 3002 sv_frame_t origCentreFrame = m_centreFrame; |
3003 | 3003 |
3004 bool someLayersIncomplete = false; | 3004 bool someLayersIncomplete = false; |
3005 | 3005 |
3006 #ifdef DEBUG_VIEW | |
3007 SVDEBUG << "View::render: checking completion" << endl; | |
3008 #endif | |
3009 | |
3006 for (LayerList::iterator i = m_layerStack.begin(); | 3010 for (LayerList::iterator i = m_layerStack.begin(); |
3007 i != m_layerStack.end(); ++i) { | 3011 i != m_layerStack.end(); ++i) { |
3008 | 3012 |
3009 int c = (*i)->getCompletion(this); | 3013 int c = (*i)->getCompletion(this); |
3014 | |
3015 #ifdef DEBUG_VIEW | |
3016 SVDEBUG << "layer " << (*i)->getLayerPresentationName() << " says " | |
3017 << c << endl; | |
3018 #endif | |
3019 | |
3010 if (c < 100) { | 3020 if (c < 100) { |
3011 someLayersIncomplete = true; | 3021 someLayersIncomplete = true; |
3012 break; | 3022 break; |
3013 } | 3023 } |
3014 } | 3024 } |
3020 | 3030 |
3021 int layerCompletion = 0; | 3031 int layerCompletion = 0; |
3022 | 3032 |
3023 while (layerCompletion < 100) { | 3033 while (layerCompletion < 100) { |
3024 | 3034 |
3035 #ifdef DEBUG_VIEW | |
3036 SVDEBUG << "View::render: checking completion (again)" << endl; | |
3037 #endif | |
3038 | |
3025 for (LayerList::iterator i = m_layerStack.begin(); | 3039 for (LayerList::iterator i = m_layerStack.begin(); |
3026 i != m_layerStack.end(); ++i) { | 3040 i != m_layerStack.end(); ++i) { |
3027 | 3041 |
3028 int c = (*i)->getCompletion(this); | 3042 int c = (*i)->getCompletion(this); |
3029 if (i == m_layerStack.begin() || c < layerCompletion) { | 3043 if (i == m_layerStack.begin() || c < layerCompletion) { |
3030 layerCompletion = c; | 3044 layerCompletion = c; |
3031 } | 3045 } |
3046 | |
3047 #ifdef DEBUG_VIEW | |
3048 SVDEBUG << "layer " << (*i)->getLayerPresentationName() << " says " | |
3049 << c << ", layerCompletion now " << layerCompletion << endl; | |
3050 #endif | |
3032 } | 3051 } |
3033 | 3052 |
3034 if (layerCompletion >= 100) break; | 3053 if (layerCompletion >= 100) break; |
3035 | 3054 |
3036 progress.setValue(layerCompletion); | 3055 progress.setValue(layerCompletion); |
3042 | 3061 |
3043 usleep(50000); | 3062 usleep(50000); |
3044 } | 3063 } |
3045 } | 3064 } |
3046 | 3065 |
3066 #ifdef DEBUG_VIEW | |
3067 SVDEBUG << "View::render: ok, we're ready" << endl; | |
3068 #endif | |
3069 | |
3047 QProgressDialog progress(tr("Rendering image..."), | 3070 QProgressDialog progress(tr("Rendering image..."), |
3048 tr("Cancel"), 0, w / width(), this); | 3071 tr("Cancel"), 0, w / width(), this); |
3049 | 3072 |
3050 for (int x = 0; x < w; x += width()) { | 3073 for (int x = 0; x < w; x += width()) { |
3051 | 3074 |