13
0

remove debug output and get logic correct to cause first render to always use the render thread

This commit is contained in:
Paul Davis 2015-06-01 14:55:17 -04:00
parent d17e35772d
commit 0288454387

View File

@ -738,8 +738,6 @@ WaveView::get_image (framepos_t start, framepos_t end) const
if (current_request->start <= start && current_request->end >= end) { if (current_request->start <= start && current_request->end >= end) {
cerr << "grabbing new image from request for " << debug_name() << endl;
ret.reset (new WaveViewCache::Entry (current_request->channel, ret.reset (new WaveViewCache::Entry (current_request->channel,
current_request->height, current_request->height,
current_request->region_amplitude, current_request->region_amplitude,
@ -750,9 +748,6 @@ WaveView::get_image (framepos_t start, framepos_t end) const
current_request->image)); current_request->image));
cache_request_result (current_request); cache_request_result (current_request);
} else {
cerr << debug_name() << " ignoring stale request\n";
} }
/* drop our handle on the current request */ /* drop our handle on the current request */
@ -843,8 +838,6 @@ WaveView::generate_image (boost::shared_ptr<WaveViewThreadRequest> req, bool in_
{ {
if (!req->should_stop()) { if (!req->should_stop()) {
cerr << name << " Generating image in " << (in_render_thread ? " RENDER " : " GUI ") << "thread\n";
/* sample position is canonical here, and we want to generate /* sample position is canonical here, and we want to generate
* an image that spans about twice the canvas width * an image that spans about twice the canvas width
*/ */
@ -916,7 +909,11 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons
{ {
assert (_samples_per_pixel != 0); assert (_samples_per_pixel != 0);
if (!rendered) {
/* first image generation should happen in RENDER thread */
get_image_in_thread = false;
rendered = true; /* comments in header file */ rendered = true; /* comments in header file */
}
if (!_region) { if (!_region) {
return; return;
@ -1022,13 +1019,10 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons
/* image not currently available. A redraw will be scheduled /* image not currently available. A redraw will be scheduled
when it is ready. when it is ready.
*/ */
cerr << debug_name() << " nothing to draw with\n";
return; return;
} }
} }
cerr << name << " image ? " << _current_image << endl;
/* fix up offset: returned value is the first sample of the returned image */ /* fix up offset: returned value is the first sample of the returned image */
image_offset = (_current_image->start - _region_start) / _samples_per_pixel; image_offset = (_current_image->start - _region_start) / _samples_per_pixel;
@ -1379,7 +1373,6 @@ WaveView::drawing_thread ()
boost::shared_ptr<WaveViewThreadRequest> req = requestor->current_request; boost::shared_ptr<WaveViewThreadRequest> req = requestor->current_request;
if (!req) { if (!req) {
cerr << requestor->debug_name() << " no current request\n";
continue; continue;
} }