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

Unified Diff: remoting/base/encoder_vp8.cc

Issue 7491070: Switch over to using SkRegions to calculate dirty areas. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed up shared lib compile Created 9 years, 4 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/base/encoder_row_based.cc ('k') | remoting/base/types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/encoder_vp8.cc
diff --git a/remoting/base/encoder_vp8.cc b/remoting/base/encoder_vp8.cc
index 447e5d5d413601b89b81db5568523a71d68ebbd7..5616bba1d4459a3cbe6c53d6b2357d3ed0088bd5 100644
--- a/remoting/base/encoder_vp8.cc
+++ b/remoting/base/encoder_vp8.cc
@@ -10,6 +10,7 @@
#include "remoting/base/capture_data.h"
#include "remoting/base/util.h"
#include "remoting/proto/video.pb.h"
+#include "third_party/skia/include/core/SkRegion.h"
extern "C" {
#define VPX_CODEC_DISABLE_COMPAT 1
@@ -148,7 +149,7 @@ bool EncoderVp8::PrepareImage(scoped_refptr<CaptureData> capture_data,
return false;
}
- const InvalidRects& rects = capture_data->dirty_rects();
+ const SkRegion& region = capture_data->dirty_region();
const uint8* in = capture_data->data_planes().data[0];
const int in_stride = capture_data->data_planes().strides[0];
const int plane_size =
@@ -160,9 +161,11 @@ bool EncoderVp8::PrepareImage(scoped_refptr<CaptureData> capture_data,
const int uv_stride = image_->stride[1];
DCHECK(updated_rects->empty());
- for (InvalidRects::const_iterator r = rects.begin(); r != rects.end(); ++r) {
+ for (SkRegion::Iterator r(region); !r.done(); r.next()) {
// Align the rectangle, report it as updated.
- gfx::Rect rect = AlignAndClipRect(*r, image_->w, image_->h);
+ SkIRect skRect = r.rect();
+ gfx::Rect rect(skRect.fLeft, skRect.fTop, skRect.width(), skRect.height());
+ rect = AlignAndClipRect(rect, image_->w, image_->h);
if (!rect.IsEmpty())
updated_rects->push_back(rect);
« no previous file with comments | « remoting/base/encoder_row_based.cc ('k') | remoting/base/types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698