#include <tileviewstate.hh>
◆ Ptr
◆ WeakPtr
◆ State
| Enumerator |
|---|
| INIT | |
| LOADED | |
| COMPUTING_BASE | |
| BASE_COMPUTED | |
| COMPUTING_ZOOM | |
| ZOOM_COMPUTED | |
| DONE | |
33 {
41 };
@ INIT
Definition tileviewstate.hh:34
@ ZOOM_COMPUTED
Definition tileviewstate.hh:39
@ BASE_COMPUTED
Definition tileviewstate.hh:37
@ DONE
Definition tileviewstate.hh:40
@ LOADED
Definition tileviewstate.hh:35
@ COMPUTING_BASE
Definition tileviewstate.hh:36
@ COMPUTING_ZOOM
Definition tileviewstate.hh:38
◆ ~TileViewState()
| TileViewState::~TileViewState |
( |
| ) |
|
|
override |
Scroom::Utils::Stuff r
Definition tileviewstate.hh:50
◆ TileViewState() [1/3]
◆ TileViewState() [2/3]
◆ TileViewState() [3/3]
| TileViewState::TileViewState |
( |
std::shared_ptr< CompressedTile > |
parent | ) |
|
|
explicitprivate |
36 :
parent(std::move(parent_))
38{
39}
ThreadPool::Ptr cpuBound
Definition tileviewstate.hh:58
std::shared_ptr< CompressedTile > parent
Definition tileviewstate.hh:44
ThreadPool::Ptr CpuBound()
Definition threadpoolimpl.cc:455
◆ clear()
| void TileViewState::clear |
( |
| ) |
|
|
private |
234{
235 boost::mutex::scoped_lock
const l(
mut);
236
238 {
240 }
241
247
249}
boost::mutex mut
Definition tileviewstate.hh:45
State state
Definition tileviewstate.hh:46
ThreadPool::Queue::Ptr queue
Definition tileviewstate.hh:48
ThreadPool::WeakQueue::Ptr weakQueue
Definition tileviewstate.hh:49
Scroom::Utils::StuffWeak lifeTimeManager
Definition tileviewstate.hh:55
Scroom::Utils::Stuff baseCache
Definition tileviewstate.hh:56
void kick()
Definition tileviewstate.cc:111
Scroom::Utils::Stuff zoomCache
Definition tileviewstate.hh:57
PageList const l
Definition compression-tests.cc:33
◆ computeBase()
193{
195
196 boost::mutex::scoped_lock
const l(
mut);
198
200 {
203 }
204}
std::weak_ptr< TiledBitmapViewData > tbvd
Definition tileviewstate.hh:52
State desiredState
Definition tileviewstate.hh:47
std::shared_ptr< TiledBitmapViewData > Ptr
Definition tiledbitmapviewdata.hh:25
std::shared_ptr< void > Stuff
Definition stuff.hh:17
◆ computeZoom()
213{
215
216 boost::mutex::scoped_lock
const l(
mut);
219 {
222 }
223}
int zoom
Definition tileviewstate.hh:54
◆ create()
27{
29
31
33}
Definition tileviewstate.hh:27
std::shared_ptr< TileViewState > Ptr
Definition tileviewstate.hh:29
SampleIterator< const uint8_t > result
Definition sampleiterator-tests.cc:94
Referenced by CompressedTile::getViewState().
◆ getCacheResult()
60{
61 boost::mutex::scoped_lock
const l(
mut);
63}
◆ kick()
| void TileViewState::kick |
( |
| ) |
|
|
private |
Kick the internal state machine into making some progress
112{
114 {
115 defect_message(
"PANIC: State LOADED and no tile shouldn't happen.");
116 }
117
119
121 {
124
127 );
128 }
129}
#define defect_message(m)
Definition assertions.hh:49
static Ptr createAsync()
Definition threadpoolimpl.cc:382
ConstTile::Ptr tile
Definition tileviewstate.hh:51
#define LOAD_PRIO
Definition local.hh:10
Referenced by clear(), setViewData(), setZoom(), and tileLoaded().
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ process()
Asynchronously do work to make the state machine progress
132{
133 for(;;)
134 {
135 boost::mutex::scoped_lock
l(
mut);
136
138 {
139 boost::function<
void()> fn;
140
142 {
144 fn = [me = shared_from_this<TileViewState>(), wq,
tile =
tile,
lo =
lo] { me->computeBase(wq,
tile,
lo); };
146 break;
147
152 break;
153
156 fn = [me = shared_from_this<TileViewState>(), wq,
tile =
tile] { me->reportDone(wq,
tile); };
157 break;
158
163 default:
165 return;
166 }
167
169 fn();
170 }
171 else
172 {
173 break;
174 }
175 }
176
177 {
178 boost::mutex::scoped_lock
const l(
mut);
179
181 {
184 }
185 }
186}
LayerOperations::Ptr lo
Definition tileviewstate.hh:53
() void(clear(nullptr)+(5 *clear(nullptr)) *5)
◆ reportDone()
226{
228 {
230 }
231}
Observable()
Definition observable.hh:171
std::list< Observer > getObservers()
Definition observable.hh:196
Definition tiledbitmaplayer.hh:80
std::shared_ptr< TileLoadingObserver > Ptr
Definition tiledbitmaplayer.hh:82
Definition blockallocator.hh:18
TestObserver::Ptr observer
Definition observable-tests.cc:91
◆ setViewData()
66{
67 boost::mutex::scoped_lock
const l(
mut);
69
71 if(!lifeTimeManager_)
72 {
73 lifeTimeManager_ = std::shared_ptr<void>(
74 reinterpret_cast<void*
>(0xDEAD), [me = shared_from_this<TileViewState>()](
auto p [[maybe_unused]]) { me->clear(); }
75 );
77 }
78 tbvd_->storeVolatileStuff(lifeTimeManager_);
79
81}
PresentationInterfaceStub::Ptr const p
Definition determine-size-test.cc:172
◆ setZoom()
84{
85 bool mustKick = false;
86
87 boost::mutex::scoped_lock
const l(
mut);
89 {
93 mustKick = true;
94
95
97 {
102 }
103 }
104
105 if(mustKick)
106 {
108 }
109}
◆ tileLoaded()
◆ baseCache
◆ cpuBound
◆ desiredState
◆ lifeTimeManager
◆ lo
◆ mut
| boost::mutex TileViewState::mut |
|
private |
◆ parent
◆ queue
◆ state
◆ tbvd
◆ tile
◆ weakQueue
◆ zoom
| int TileViewState::zoom {0} |
|
private |
◆ zoomCache
The documentation for this class was generated from the following files: