diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-14 00:23:06 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-14 00:23:06 +0000 |
commit | 90536170b1ae4552510ab79a729f047a4108b4de (patch) | |
tree | 7c0ffc37f350998337deb1d9f7c94b834fb78db3 /cc/base | |
parent | 97d70bcb15074786a861a43411162285f3876f09 (diff) | |
download | chromium_src-90536170b1ae4552510ab79a729f047a4108b4de.zip chromium_src-90536170b1ae4552510ab79a729f047a4108b4de.tar.gz chromium_src-90536170b1ae4552510ab79a729f047a4108b4de.tar.bz2 |
cc: Add to invalidation to PictureLayerImpl::AsValue
For efficiency, the invalidation region is just a list of x/y/w/h values
for each invalidated integer rectangle.
R=nduca@chromium.org
BUG=none
Review URL: https://chromiumcodereview.appspot.com/14781005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199866 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/base')
-rw-r--r-- | cc/base/region.cc | 13 | ||||
-rw-r--r-- | cc/base/region.h | 6 |
2 files changed, 19 insertions, 0 deletions
diff --git a/cc/base/region.cc b/cc/base/region.cc index 7d63345..2cc4309 100644 --- a/cc/base/region.cc +++ b/cc/base/region.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "cc/base/region.h" +#include "base/values.h" namespace cc { @@ -103,6 +104,18 @@ std::string Region::ToString() const { return result; } +scoped_ptr<base::Value> Region::AsValue() const { + scoped_ptr<base::ListValue> result(new base::ListValue()); + for (Iterator it(*this); it.has_rect(); it.next()) { + gfx::Rect rect(it.rect()); + result->AppendInteger(rect.x()); + result->AppendInteger(rect.y()); + result->AppendInteger(rect.width()); + result->AppendInteger(rect.height()); + } + return result.PassAs<base::Value>(); +} + Region::Iterator::Iterator() { } diff --git a/cc/base/region.h b/cc/base/region.h index fd2a7e5..7cced3a 100644 --- a/cc/base/region.h +++ b/cc/base/region.h @@ -8,11 +8,16 @@ #include <string> #include "base/logging.h" +#include "base/memory/scoped_ptr.h" #include "cc/base/cc_export.h" #include "third_party/skia/include/core/SkRegion.h" #include "ui/gfx/rect.h" #include "ui/gfx/skia_util.h" +namespace base { +class Value; +} + namespace cc { class CC_EXPORT Region { @@ -52,6 +57,7 @@ class CC_EXPORT Region { } std::string ToString() const; + scoped_ptr<base::Value> AsValue() const; class CC_EXPORT Iterator { public: |