OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This class is an implementation of the ChromotingView using Pepper devices | 5 // This class is an implementation of the ChromotingView using Pepper devices |
6 // as the backing stores. The public APIs to this class are thread-safe. | 6 // as the backing stores. The public APIs to this class are thread-safe. |
7 // Calls will dispatch any interaction with the pepper API onto the pepper | 7 // Calls will dispatch any interaction with the pepper API onto the pepper |
8 // main thread. | 8 // main thread. |
9 // | 9 // |
10 // TODO(ajwong): We need to better understand the threading semantics of this | 10 // TODO(ajwong): We need to better understand the threading semantics of this |
11 // class. Currently, we're just going to always run everything on the pepper | 11 // class. Currently, we're just going to always run everything on the pepper |
12 // main thread. Is this smart? | 12 // main thread. Is this smart? |
13 | 13 |
14 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_VIEW_H_ | 14 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_VIEW_H_ |
15 #define REMOTING_CLIENT_PLUGIN_PEPPER_VIEW_H_ | 15 #define REMOTING_CLIENT_PLUGIN_PEPPER_VIEW_H_ |
16 | 16 |
17 #include "base/scoped_ptr.h" | 17 #include "base/scoped_ptr.h" |
18 #include "base/task.h" | 18 #include "base/task.h" |
19 #include "media/base/video_frame.h" | 19 #include "media/base/video_frame.h" |
20 #include "remoting/base/decoder.h" | |
21 #include "remoting/client/chromoting_view.h" | 20 #include "remoting/client/chromoting_view.h" |
22 #include "third_party/ppapi/cpp/device_context_2d.h" | 21 #include "third_party/ppapi/cpp/device_context_2d.h" |
23 | 22 |
24 namespace remoting { | 23 namespace remoting { |
25 | 24 |
26 class ChromotingInstance; | 25 class ChromotingInstance; |
27 class Decoder; | |
28 | 26 |
29 class PepperView : public ChromotingView { | 27 class PepperView : public ChromotingView { |
30 public: | 28 public: |
31 // Constructs a PepperView that draws to the |rendering_device|. The | 29 // Constructs a PepperView that draws to the |rendering_device|. The |
32 // |rendering_device| instance must outlive this class. | 30 // |rendering_device| instance must outlive this class. |
33 // | 31 // |
34 // TODO(ajwong): This probably needs to synchronize with the pepper thread | 32 // TODO(ajwong): This probably needs to synchronize with the pepper thread |
35 // to be safe. | 33 // to be safe. |
36 explicit PepperView(ChromotingInstance* instance); | 34 explicit PepperView(ChromotingInstance* instance); |
37 virtual ~PepperView(); | 35 virtual ~PepperView(); |
(...skipping 15 matching lines...) Expand all Loading... |
53 void OnPartialDecodeDone(); | 51 void OnPartialDecodeDone(); |
54 void OnDecodeDone(); | 52 void OnDecodeDone(); |
55 | 53 |
56 // Reference to the creating plugin instance. Needed for interacting with | 54 // Reference to the creating plugin instance. Needed for interacting with |
57 // pepper. Marking explciitly as const since it must be initialized at | 55 // pepper. Marking explciitly as const since it must be initialized at |
58 // object creation, and never change. | 56 // object creation, and never change. |
59 ChromotingInstance* const instance_; | 57 ChromotingInstance* const instance_; |
60 | 58 |
61 pp::DeviceContext2D device_context_; | 59 pp::DeviceContext2D device_context_; |
62 | 60 |
63 int backing_store_width_; | |
64 int backing_store_height_; | |
65 | |
66 int viewport_x_; | 61 int viewport_x_; |
67 int viewport_y_; | 62 int viewport_y_; |
68 int viewport_width_; | 63 int viewport_width_; |
69 int viewport_height_; | 64 int viewport_height_; |
70 | 65 |
71 bool is_static_fill_; | 66 bool is_static_fill_; |
72 uint32 static_fill_color_; | 67 uint32 static_fill_color_; |
73 | 68 |
74 scoped_refptr<media::VideoFrame> frame_; | |
75 UpdatedRects update_rects_; | |
76 UpdatedRects all_update_rects_; | |
77 | |
78 scoped_ptr<Decoder> decoder_; | |
79 | |
80 DISALLOW_COPY_AND_ASSIGN(PepperView); | 69 DISALLOW_COPY_AND_ASSIGN(PepperView); |
81 }; | 70 }; |
82 | 71 |
83 } // namespace remoting | 72 } // namespace remoting |
84 | 73 |
85 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::PepperView); | 74 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::PepperView); |
86 | 75 |
87 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_VIEW_H_ | 76 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_VIEW_H_ |
OLD | NEW |