diff options
author | schenney <schenney@chromium.org> | 2015-02-12 17:14:26 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-13 01:15:11 +0000 |
commit | 0451901e7b5a079ff17240f1b1c797c6946b0735 (patch) | |
tree | 891abc544b3c79714d6a93027a60487e56200712 | |
parent | fc7de7c781e8043b08d58a9e6596c4fb73040c8a (diff) | |
download | chromium_src-0451901e7b5a079ff17240f1b1c797c6946b0735.zip chromium_src-0451901e7b5a079ff17240f1b1c797c6946b0735.tar.gz chromium_src-0451901e7b5a079ff17240f1b1c797c6946b0735.tar.bz2 |
Constify SkPicture in DrawingDisplayItem
This initial patch just adds the web-facing methods for cc,
allowing the Blink side web classes to change to the new
form. Yet another patch will move cc completely to the new
form.
The SkPicture is immutable and should be const in a DrawingDisplayItem.
And there is no need for the location point; it is stored in the
cullRect of the picture.
R=ajuma@chromium.org
BUG=458240
Review URL: https://codereview.chromium.org/913413005
Cr-Commit-Position: refs/heads/master@{#316116}
-rw-r--r-- | cc/blink/web_display_item_list_impl.cc | 6 | ||||
-rw-r--r-- | cc/blink/web_display_item_list_impl.h | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/cc/blink/web_display_item_list_impl.cc b/cc/blink/web_display_item_list_impl.cc index 879857c..294d6f1 100644 --- a/cc/blink/web_display_item_list_impl.cc +++ b/cc/blink/web_display_item_list_impl.cc @@ -33,6 +33,12 @@ scoped_refptr<cc::DisplayItemList> WebDisplayItemListImpl::ToDisplayItemList() { return display_item_list_; } +void WebDisplayItemListImpl::appendDrawingItem(const SkPicture* picture) { + display_item_list_->AppendItem(cc::DrawingDisplayItem::Create( + skia::SharePtr(const_cast<SkPicture*>(picture)), + gfx::PointF(picture->cullRect().x(), picture->cullRect().y()))); +} + void WebDisplayItemListImpl::appendDrawingItem( SkPicture* picture, const blink::WebFloatPoint& location) { diff --git a/cc/blink/web_display_item_list_impl.h b/cc/blink/web_display_item_list_impl.h index 136aed6..f2ff8c6 100644 --- a/cc/blink/web_display_item_list_impl.h +++ b/cc/blink/web_display_item_list_impl.h @@ -14,6 +14,7 @@ #include "third_party/WebKit/public/platform/WebFloatPoint.h" #include "third_party/WebKit/public/platform/WebVector.h" #include "third_party/skia/include/core/SkRegion.h" +#include "ui/gfx/geometry/point_f.h" class SkImageFilter; class SkMatrix44; @@ -31,7 +32,8 @@ class WebDisplayItemListImpl : public blink::WebDisplayItemList { scoped_refptr<cc::DisplayItemList> ToDisplayItemList(); // blink::WebDisplayItemList implementation. - virtual void appendDrawingItem(SkPicture* picture, + virtual void appendDrawingItem(const SkPicture*); + virtual void appendDrawingItem(SkPicture*, const blink::WebFloatPoint& location); virtual void appendClipItem( const blink::WebRect& clip_rect, |