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

Unified Diff: remoting/client/plugin/pepper_view.cc

Issue 7992011: Move us fully from gfx:: over to skia types for consistency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix for bad DEPS Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/plugin/pepper_view.h ('k') | remoting/client/plugin/pepper_view_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/pepper_view.cc
diff --git a/remoting/client/plugin/pepper_view.cc b/remoting/client/plugin/pepper_view.cc
index d05a22e1f55168c4d946e9bdee579a5c7090ce56..6a58c7817e2fc6039cecc10d067dc3d3c4046868 100644
--- a/remoting/client/plugin/pepper_view.cc
+++ b/remoting/client/plugin/pepper_view.cc
@@ -74,7 +74,7 @@ void PepperView::Paint() {
}
}
-void PepperView::SetHostSize(const gfx::Size& host_size) {
+void PepperView::SetHostSize(const SkISize& host_size) {
DCHECK(context_->main_message_loop()->BelongsToCurrentThread());
if (host_size_ == host_size)
@@ -87,10 +87,10 @@ void PepperView::SetHostSize(const gfx::Size& host_size) {
host_size.width(), host_size.height());
}
-void PepperView::PaintFrame(media::VideoFrame* frame, UpdatedRects* rects) {
+void PepperView::PaintFrame(media::VideoFrame* frame, RectVector* rects) {
DCHECK(context_->main_message_loop()->BelongsToCurrentThread());
- SetHostSize(gfx::Size(frame->width(), frame->height()));
+ SetHostSize(SkISize::Make(frame->width(), frame->height()));
if (!backing_store_.get() || backing_store_->is_null()) {
LOG(ERROR) << "Backing store is not available.";
@@ -108,26 +108,26 @@ void PepperView::PaintFrame(media::VideoFrame* frame, UpdatedRects* rects) {
FlushGraphics(start_time);
}
-bool PepperView::PaintRect(media::VideoFrame* frame, const gfx::Rect& r) {
+bool PepperView::PaintRect(media::VideoFrame* frame, const SkIRect& r) {
const uint8* frame_data = frame->data(media::VideoFrame::kRGBPlane);
const int kFrameStride = frame->stride(media::VideoFrame::kRGBPlane);
const int kBytesPerPixel = GetBytesPerPixel(media::VideoFrame::RGB32);
pp::Size backing_store_size = backing_store_->size();
- gfx::Rect rect = r.Intersect(gfx::Rect(0, 0, backing_store_size.width(),
- backing_store_size.height()));
-
- if (rect.IsEmpty())
+ SkIRect rect(r);
+ if (!rect.intersect(SkIRect::MakeWH(backing_store_size.width(),
+ backing_store_size.height()))) {
return false;
+ }
const uint8* in =
frame_data +
- kFrameStride * rect.y() + // Y offset.
- kBytesPerPixel * rect.x(); // X offset.
+ kFrameStride * rect.fTop + // Y offset.
+ kBytesPerPixel * rect.fLeft; // X offset.
uint8* out =
reinterpret_cast<uint8*>(backing_store_->data()) +
- backing_store_->stride() * rect.y() + // Y offset.
- kBytesPerPixel * rect.x(); // X offset.
+ backing_store_->stride() * rect.fTop + // Y offset.
+ kBytesPerPixel * rect.fLeft; // X offset.
// TODO(hclam): We really should eliminate this memory copy.
for (int j = 0; j < rect.height(); ++j) {
@@ -141,7 +141,7 @@ bool PepperView::PaintRect(media::VideoFrame* frame, const gfx::Rect& r) {
graphics2d_.PaintImageData(
*backing_store_.get(),
pp::Point(0, 0),
- pp::Rect(rect.x(), rect.y(), rect.width(), rect.height()));
+ pp::Rect(rect.fLeft, rect.fTop, rect.width(), rect.height()));
return true;
}
@@ -239,7 +239,7 @@ void PepperView::UpdateLoginStatus(bool success, const std::string& info) {
scriptable_obj->SignalLoginChallenge();
}
-bool PepperView::SetPluginSize(const gfx::Size& plugin_size) {
+bool PepperView::SetPluginSize(const SkISize& plugin_size) {
if (plugin_size_ == plugin_size)
return false;
plugin_size_ = plugin_size;
@@ -252,7 +252,7 @@ bool PepperView::SetPluginSize(const gfx::Size& plugin_size) {
return false;
}
- if (plugin_size.IsEmpty())
+ if (plugin_size.isEmpty())
return false;
// Allocate the backing store to save the desktop image.
@@ -271,7 +271,7 @@ bool PepperView::SetPluginSize(const gfx::Size& plugin_size) {
double PepperView::GetHorizontalScaleRatio() const {
if (instance_->DoScaling()) {
- DCHECK(!host_size_.IsEmpty());
+ DCHECK(!host_size_.isEmpty());
return 1.0 * plugin_size_.width() / host_size_.width();
}
return 1.0;
@@ -279,7 +279,7 @@ double PepperView::GetHorizontalScaleRatio() const {
double PepperView::GetVerticalScaleRatio() const {
if (instance_->DoScaling()) {
- DCHECK(!host_size_.IsEmpty());
+ DCHECK(!host_size_.isEmpty());
return 1.0 * plugin_size_.height() / host_size_.height();
}
return 1.0;
@@ -311,7 +311,7 @@ void PepperView::ReleaseFrame(media::VideoFrame* frame) {
}
void PepperView::OnPartialFrameOutput(media::VideoFrame* frame,
- UpdatedRects* rects,
+ RectVector* rects,
Task* done) {
DCHECK(context_->main_message_loop()->BelongsToCurrentThread());
« no previous file with comments | « remoting/client/plugin/pepper_view.h ('k') | remoting/client/plugin/pepper_view_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698