| 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 #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/plugin/chromoting_instance.h" | 8 #include "remoting/client/plugin/chromoting_instance.h" |
| 9 #include "remoting/client/plugin/pepper_util.h" | 9 #include "remoting/client/plugin/pepper_util.h" |
| 10 #include "third_party/ppapi/cpp/device_context_2d.h" | 10 #include "third_party/ppapi/cpp/graphics_2d.h" |
| 11 #include "third_party/ppapi/cpp/image_data.h" | 11 #include "third_party/ppapi/cpp/image_data.h" |
| 12 #include "third_party/ppapi/cpp/point.h" | 12 #include "third_party/ppapi/cpp/point.h" |
| 13 #include "third_party/ppapi/cpp/size.h" | 13 #include "third_party/ppapi/cpp/size.h" |
| 14 | 14 |
| 15 namespace remoting { | 15 namespace remoting { |
| 16 | 16 |
| 17 PepperView::PepperView(ChromotingInstance* instance) | 17 PepperView::PepperView(ChromotingInstance* instance) |
| 18 : instance_(instance), | 18 : instance_(instance), |
| 19 viewport_x_(0), | 19 viewport_x_(0), |
| 20 viewport_y_(0), | 20 viewport_y_(0), |
| 21 viewport_width_(0), | 21 viewport_width_(0), |
| 22 viewport_height_(0), | 22 viewport_height_(0), |
| 23 is_static_fill_(false), | 23 is_static_fill_(false), |
| 24 static_fill_color_(0) { | 24 static_fill_color_(0) { |
| 25 } | 25 } |
| 26 | 26 |
| 27 PepperView::~PepperView() { | 27 PepperView::~PepperView() { |
| 28 } | 28 } |
| 29 | 29 |
| 30 bool PepperView::Initialize() { | 30 bool PepperView::Initialize() { |
| 31 return true; | 31 return true; |
| 32 } | 32 } |
| 33 | 33 |
| 34 void PepperView::TearDown() { | 34 void PepperView::TearDown() { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 // TODO(ajwong): Should we ignore x & y updates? What do those even mean? | 111 // TODO(ajwong): Should we ignore x & y updates? What do those even mean? |
| 112 | 112 |
| 113 // TODO(ajwong): What does viewport x, y mean to a plugin anyways? | 113 // TODO(ajwong): What does viewport x, y mean to a plugin anyways? |
| 114 viewport_x_ = x; | 114 viewport_x_ = x; |
| 115 viewport_y_ = y; | 115 viewport_y_ = y; |
| 116 viewport_width_ = width; | 116 viewport_width_ = width; |
| 117 viewport_height_ = height; | 117 viewport_height_ = height; |
| 118 | 118 |
| 119 device_context_ = | 119 device_context_ = |
| 120 pp::DeviceContext2D(pp::Size(viewport_width_, viewport_height_), false); | 120 pp::Graphics2D(pp::Size(viewport_width_, viewport_height_), false); |
| 121 if (!instance_->BindGraphicsDeviceContext(device_context_)) { | 121 if (!instance_->BindGraphics(device_context_)) { |
| 122 LOG(ERROR) << "Couldn't bind the device context."; | 122 LOG(ERROR) << "Couldn't bind the device context."; |
| 123 return; | 123 return; |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 void PepperView::SetHostScreenSize(int width, int height) { | 127 void PepperView::SetHostScreenSize(int width, int height) { |
| 128 if (!instance_->CurrentlyOnPluginThread()) { | 128 if (!instance_->CurrentlyOnPluginThread()) { |
| 129 RunTaskOnPluginThread(NewRunnableMethod(this, | 129 RunTaskOnPluginThread(NewRunnableMethod(this, |
| 130 &PepperView::SetHostScreenSize, | 130 &PepperView::SetHostScreenSize, |
| 131 width, height)); | 131 width, height)); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 update_rects_.begin(), update_rects_.end()); | 201 update_rects_.begin(), update_rects_.end()); |
| 202 Paint(); | 202 Paint(); |
| 203 // TODO(ajwong): Need to block here to be synchronous. | 203 // TODO(ajwong): Need to block here to be synchronous. |
| 204 } | 204 } |
| 205 | 205 |
| 206 | 206 |
| 207 void PepperView::OnDecodeDone() { | 207 void PepperView::OnDecodeDone() { |
| 208 } | 208 } |
| 209 | 209 |
| 210 } // namespace remoting | 210 } // namespace remoting |
| OLD | NEW |