Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: remoting/client/plugin/pepper_view.cc

Issue 2861047: Refactor the client code. Move all x11-related code into X11View and create... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "remoting/client/plugin/pepper_view.h" 5 #include "remoting/client/plugin/pepper_view.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "remoting/client/decoder_verbatim.h" 8 #include "remoting/client/decoder_verbatim.h"
9 #include "remoting/client/plugin/chromoting_plugin.h" 9 #include "remoting/client/plugin/chromoting_plugin.h"
10 #include "remoting/client/plugin/pepper_util.h" 10 #include "remoting/client/plugin/pepper_util.h"
(...skipping 12 matching lines...) Expand all
23 viewport_y_(0), 23 viewport_y_(0),
24 viewport_width_(0), 24 viewport_width_(0),
25 viewport_height_(0), 25 viewport_height_(0),
26 is_static_fill_(false), 26 is_static_fill_(false),
27 static_fill_color_(0) { 27 static_fill_color_(0) {
28 } 28 }
29 29
30 PepperView::~PepperView() { 30 PepperView::~PepperView() {
31 } 31 }
32 32
33 bool PepperView::Initialize() {
34 return true;
35 }
36
37 void PepperView::TearDown() {
38 }
39
33 void PepperView::Paint() { 40 void PepperView::Paint() {
34 if (!plugin_->CurrentlyOnPluginThread()) { 41 if (!plugin_->CurrentlyOnPluginThread()) {
35 RunTaskOnPluginThread(NewRunnableMethod(this, &PepperView::Paint)); 42 RunTaskOnPluginThread(NewRunnableMethod(this, &PepperView::Paint));
36 return; 43 return;
37 } 44 }
38 45
39 // TODO(ajwong): We shouldn't assume the image data format. 46 // TODO(ajwong): We shouldn't assume the image data format.
40 pp::ImageData image(PP_IMAGEDATAFORMAT_BGRA_PREMUL, 47 pp::ImageData image(PP_IMAGEDATAFORMAT_BGRA_PREMUL,
41 pp::Size(viewport_width_, viewport_height_), 48 pp::Size(viewport_width_, viewport_height_),
42 false); 49 false);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 viewport_height_ = height; 118 viewport_height_ = height;
112 119
113 device_context_ = 120 device_context_ =
114 pp::DeviceContext2D(pp::Size(viewport_width_, viewport_height_), false); 121 pp::DeviceContext2D(pp::Size(viewport_width_, viewport_height_), false);
115 if (!plugin_->BindGraphicsDeviceContext(device_context_)) { 122 if (!plugin_->BindGraphicsDeviceContext(device_context_)) {
116 LOG(ERROR) << "Couldn't bind the device context."; 123 LOG(ERROR) << "Couldn't bind the device context.";
117 return; 124 return;
118 } 125 }
119 } 126 }
120 127
121 void PepperView::SetBackingStoreSize(int width, int height) { 128 void PepperView::SetHostScreenSize(int width, int height) {
122 if (!plugin_->CurrentlyOnPluginThread()) { 129 if (!plugin_->CurrentlyOnPluginThread()) {
123 RunTaskOnPluginThread(NewRunnableMethod(this, 130 RunTaskOnPluginThread(NewRunnableMethod(this,
124 &PepperView::SetBackingStoreSize, 131 &PepperView::SetHostScreenSize,
125 width, height)); 132 width, height));
126 return; 133 return;
127 } 134 }
128 135
129 backing_store_width_ = width; 136 backing_store_width_ = width;
130 backing_store_height_ = height; 137 backing_store_height_ = height;
131 } 138 }
132 139
133 void PepperView::HandleBeginUpdateStream(HostMessage* msg) { 140 void PepperView::HandleBeginUpdateStream(HostMessage* msg) {
134 if (!plugin_->CurrentlyOnPluginThread()) { 141 if (!plugin_->CurrentlyOnPluginThread()) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 update_rects_.begin(), update_rects_.end()); 202 update_rects_.begin(), update_rects_.end());
196 Paint(); 203 Paint();
197 // TODO(ajwong): Need to block here to be synchronous. 204 // TODO(ajwong): Need to block here to be synchronous.
198 } 205 }
199 206
200 207
201 void PepperView::OnDecodeDone() { 208 void PepperView::OnDecodeDone() {
202 } 209 }
203 210
204 } // namespace remoting 211 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698