diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/lltexturefetch.h | 73 |
1 files changed, 66 insertions, 7 deletions
diff --git a/linden/indra/newview/lltexturefetch.h b/linden/indra/newview/lltexturefetch.h index 29cac99..a53deae 100644 --- a/linden/indra/newview/lltexturefetch.h +++ b/linden/indra/newview/lltexturefetch.h | |||
@@ -28,20 +28,79 @@ | |||
28 | #ifndef LL_LLTEXTUREFETCH_H | 28 | #ifndef LL_LLTEXTUREFETCH_H |
29 | #define LL_LLTEXTUREFETCH_H | 29 | #define LL_LLTEXTUREFETCH_H |
30 | 30 | ||
31 | #include "lldir.h" | ||
32 | #include "llimage.h" | ||
33 | #include "lluuid.h" | ||
31 | #include "llworkerthread.h" | 34 | #include "llworkerthread.h" |
32 | 35 | ||
33 | class LLViewerImage; | 36 | class LLViewerImage; |
37 | class LLTextureFetchWorker; | ||
38 | class LLTextureCache; | ||
39 | class LLHost; | ||
34 | 40 | ||
35 | // Interface class | 41 | // Interface class |
36 | class LLTextureFetch | 42 | class LLTextureFetch : public LLWorkerThread |
37 | { | 43 | { |
44 | friend class LLTextureFetchWorker; | ||
45 | |||
38 | public: | 46 | public: |
39 | static void initClass(); | 47 | LLTextureFetch(LLTextureCache* cache, bool threaded); |
40 | static void updateClass(); | 48 | ~LLTextureFetch(); |
41 | static void cleanupClass(); | ||
42 | 49 | ||
43 | static LLWorkerClass::handle_t addRequest(LLImageFormatted* image, S32 discard); | 50 | /*virtual*/ S32 update(U32 max_time_ms); |
44 | static bool getRequestFinished(LLWorkerClass::handle_t handle); | 51 | |
52 | bool createRequest(const LLUUID& id, const LLHost& host, F32 priority, | ||
53 | S32 w, S32 h, S32 c, S32 discard, bool needs_aux); | ||
54 | void deleteRequest(const LLUUID& id, bool cancel); | ||
55 | bool getRequestFinished(const LLUUID& id, S32& discard_level, | ||
56 | LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux); | ||
57 | bool updateRequestPriority(const LLUUID& id, F32 priority); | ||
58 | |||
59 | bool receiveImageHeader(const LLHost& host, const LLUUID& id, U8 codec, U16 packets, U32 totalbytes, U16 data_size, U8* data); | ||
60 | bool receiveImagePacket(const LLHost& host, const LLUUID& id, U16 packet_num, U16 data_size, U8* data); | ||
61 | |||
62 | // Debug | ||
63 | S32 getFetchState(const LLUUID& id, F32& decode_progress_p, F32& requested_priority_p, | ||
64 | U32& fetch_priority_p, F32& fetch_dtime_p, F32& request_dtime_p); | ||
65 | void dump(); | ||
66 | S32 getNumRequests() { return mRequestMap.size(); } | ||
67 | |||
68 | // Public for access by callbacks | ||
69 | void lockQueue() { mQueueMutex.lock(); } | ||
70 | void unlockQueue() { mQueueMutex.unlock(); } | ||
71 | LLTextureFetchWorker* getWorker(const LLUUID& id); | ||
72 | |||
73 | protected: | ||
74 | void addToNetworkQueue(LLTextureFetchWorker* worker); | ||
75 | void removeFromNetworkQueue(LLTextureFetchWorker* worker); | ||
76 | void removeRequest(LLTextureFetchWorker* worker, bool cancel); | ||
77 | |||
78 | private: | ||
79 | void sendRequestListToSimulators(); | ||
80 | |||
81 | public: | ||
82 | LLUUID mDebugID; | ||
83 | S32 mDebugCount; | ||
84 | BOOL mDebugPause; | ||
85 | S32 mPacketCount; | ||
86 | S32 mBadPacketCount; | ||
87 | |||
88 | private: | ||
89 | LLMutex mQueueMutex; | ||
90 | |||
91 | LLTextureCache* mTextureCache; | ||
92 | |||
93 | // Map of all requests by UUID | ||
94 | typedef std::map<LLUUID,LLTextureFetchWorker*> map_t; | ||
95 | map_t mRequestMap; | ||
96 | |||
97 | // Set of requests that require network data | ||
98 | typedef std::set<LLUUID> queue_t; | ||
99 | queue_t mNetworkQueue; | ||
100 | typedef std::map<LLHost,std::set<LLUUID> > cancel_queue_t; | ||
101 | cancel_queue_t mCancelQueue; | ||
102 | |||
103 | LLFrameTimer mNetworkTimer; | ||
45 | }; | 104 | }; |
46 | 105 | ||
47 | #endif LL_LLTEXTUREFETCH_H | 106 | #endif // LL_LLTEXTUREFETCH_H |