Free Electron
DrawThreaded.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __draw_DrawThreaded_h__
8 #define __draw_DrawThreaded_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Off-threaded rendering
17 
18  @ingroup draw
19 *//***************************************************************************/
20 class FE_DL_EXPORT DrawThreaded: public DrawCached,
21  public Initialize<DrawThreaded>
22 {
23  public:
24  DrawThreaded(void);
25 virtual ~DrawThreaded(void);
26 
27  void initialize(void);
28 
29 virtual void flush(void);
30 
31  private:
32 
33  class RenderWorker: public Thread::Functor
34  {
35  public:
36  RenderWorker(sp< JobQueue<I32> > a_spJobQueue,
37  U32 a_id,String a_stage):
38  m_id(a_id),
39  m_hpJobQueue(a_spJobQueue) {}
40 
41  virtual ~RenderWorker(void) {}
42 
43  virtual void operate(void);
44 
45  void setObject(sp<Component> spObject)
46  { m_hpDrawThreaded=spObject; }
47 
48  private:
49  U32 m_id;
50  hp< JobQueue<I32> > m_hpJobQueue;
51  hp<DrawThreaded> m_hpDrawThreaded;
52  };
53 
54  U32 m_jobs;
55  I32 m_rendered;
56  BWORD m_released;
57  sp< JobQueue<I32> > m_spJobQueue;
58  sp< Gang<RenderWorker,I32> > m_spGang;
59 };
60 
61 } /* namespace ext */
62 } /* namespace fe */
63 
64 #endif /* __draw_DrawThreaded_h__ */
65 
kernel
Definition: namespace.dox:3
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
Delayed rendering to another DrawI, presumably an immediate one.
Definition: DrawCached.h:25
Safe handle for shared pointer.
Definition: Handled.h:61
Automatically reference-counted string container.
Definition: String.h:128
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
Off-threaded rendering.
Definition: DrawThreaded.h:20