FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
NpapiAsyncDrawService.h
1 /**********************************************************\
2 Original Author: Gil Gonen
3 
4 Created: Jan 28, 2013
5 License: Dual license model; choose one of two:
6  New BSD License
7  http://www.opensource.org/licenses/bsd-license.php
8  - or -
9  GNU Lesser General Public License, version 2.1
10  http://www.gnu.org/licenses/lgpl-2.1.html
11 
12 Copyright 2013 Gil Gonen and the Firebreath development team
13 \**********************************************************/
14 
15 #pragma once
16 #ifndef H_NPAPIASYNCDRAWSERVICE
17 #define H_NPAPIASYNCDRAWSERVICE
18 
19 #include "NpapiBrowserHost.h"
20 #include "Win\D3d10AsyncDrawService.h"
21 
22 namespace FB {
23  namespace Npapi {
24 
25  FB_FORWARD_PTR(NpapiAsyncDrawService);
26 
32  class NpapiAsyncDrawService : public D3d10AsyncDrawService
33  {
34  // wrap the NPAsyncSurface to track initialised state
35  struct Surface : public NPAsyncSurface
36  {
37  Surface();
38  NPError init(NpapiBrowserHost*, NPSize*);
39  void finalize(NpapiBrowserHost*);
40  void makeCurrent(NpapiBrowserHost*);
41  bool sizeIsDifferent(unsigned, unsigned) const;
42  bool valid;
43  };
44 
45  static void finalizeSurfaces(NpapiBrowserHostWeakPtr weakHost, Surface a, Surface b);
46 
47  NpapiBrowserHostWeakPtr m_weakHost;
48  Surface m_surface[2];
49  int m_current;
50 
51  virtual void present(bool resizing);
52 
53  public:
54  NpapiAsyncDrawService(NpapiBrowserHostPtr host);
56  };
57  };
58 };
59 
60 #endif
Provides a D3d10AsyncDrawService implementation for NPAPI.
Provides a FB::BrowserHost implementation for Npapi.