forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cc: Implement a display-list-based RecordingSource and RasterSource
This defines a RecordingSource that records into a display list. This also defines a corresponding RasterSource. Bug=None Review URL: https://codereview.chromium.org/753263002 Cr-Commit-Position: refs/heads/master@{#305982}
- Loading branch information
Showing
52 changed files
with
1,940 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// Copyright 2014 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "cc/blink/web_display_item_list_impl.h" | ||
|
||
#include <vector> | ||
|
||
#include "cc/blink/web_blend_mode.h" | ||
#include "cc/resources/clip_display_item.h" | ||
#include "cc/resources/drawing_display_item.h" | ||
#include "cc/resources/filter_display_item.h" | ||
#include "cc/resources/transform_display_item.h" | ||
#include "cc/resources/transparency_display_item.h" | ||
#include "skia/ext/refptr.h" | ||
#include "third_party/WebKit/public/platform/WebFloatRect.h" | ||
#include "third_party/WebKit/public/platform/WebRect.h" | ||
#include "third_party/skia/include/core/SkImageFilter.h" | ||
#include "third_party/skia/include/core/SkPicture.h" | ||
#include "third_party/skia/include/utils/SkMatrix44.h" | ||
#include "ui/gfx/transform.h" | ||
|
||
namespace cc_blink { | ||
|
||
WebDisplayItemListImpl::WebDisplayItemListImpl() | ||
: display_item_list_(cc::DisplayItemList::Create()) { | ||
} | ||
|
||
scoped_refptr<cc::DisplayItemList> WebDisplayItemListImpl::ToDisplayItemList() { | ||
return display_item_list_; | ||
} | ||
|
||
void WebDisplayItemListImpl::appendDrawingItem( | ||
SkPicture* picture, | ||
const blink::WebFloatPoint& location) { | ||
display_item_list_->AppendItem( | ||
cc::DrawingDisplayItem::Create(skia::SharePtr(picture), location)); | ||
} | ||
|
||
void WebDisplayItemListImpl::appendClipItem( | ||
const blink::WebRect& clip_rect, | ||
const blink::WebVector<SkRRect>& rounded_clip_rects) { | ||
std::vector<SkRRect> rounded_rects; | ||
for (size_t i = 0; i < rounded_clip_rects.size(); ++i) { | ||
rounded_rects.push_back(rounded_clip_rects[i]); | ||
} | ||
display_item_list_->AppendItem( | ||
cc::ClipDisplayItem::Create(clip_rect, rounded_rects)); | ||
} | ||
|
||
void WebDisplayItemListImpl::appendEndClipItem() { | ||
display_item_list_->AppendItem(cc::EndClipDisplayItem::Create()); | ||
} | ||
|
||
void WebDisplayItemListImpl::appendTransformItem(const SkMatrix44& matrix) { | ||
gfx::Transform transform; | ||
transform.matrix() = matrix; | ||
display_item_list_->AppendItem(cc::TransformDisplayItem::Create(transform)); | ||
} | ||
|
||
void WebDisplayItemListImpl::appendTransparencyItem( | ||
float opacity, | ||
blink::WebBlendMode blend_mode) { | ||
display_item_list_->AppendItem(cc::TransparencyDisplayItem::Create( | ||
opacity, BlendModeToSkia(blend_mode))); | ||
} | ||
|
||
void WebDisplayItemListImpl::appendEndTransformItem() { | ||
display_item_list_->AppendItem(cc::EndTransformDisplayItem::Create()); | ||
} | ||
|
||
void WebDisplayItemListImpl::appendEndTransparencyItem() { | ||
display_item_list_->AppendItem(cc::EndTransparencyDisplayItem::Create()); | ||
} | ||
|
||
void WebDisplayItemListImpl::appendFilterItem( | ||
SkImageFilter* filter, | ||
const blink::WebFloatRect& bounds) { | ||
display_item_list_->AppendItem( | ||
cc::FilterDisplayItem::Create(skia::SharePtr(filter), bounds)); | ||
} | ||
|
||
void WebDisplayItemListImpl::appendEndFilterItem() { | ||
display_item_list_->AppendItem(cc::EndFilterDisplayItem::Create()); | ||
} | ||
|
||
WebDisplayItemListImpl::~WebDisplayItemListImpl() { | ||
} | ||
|
||
} // namespace cc_blink |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright 2014 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CC_BLINK_WEB_DISPLAY_ITEM_LIST_IMPL_H_ | ||
#define CC_BLINK_WEB_DISPLAY_ITEM_LIST_IMPL_H_ | ||
|
||
#include "base/memory/ref_counted.h" | ||
#include "cc/blink/cc_blink_export.h" | ||
#include "cc/resources/display_item_list.h" | ||
#include "third_party/WebKit/public/platform/WebBlendMode.h" | ||
#include "third_party/WebKit/public/platform/WebContentLayerClient.h" | ||
#include "third_party/WebKit/public/platform/WebFloatPoint.h" | ||
#include "third_party/WebKit/public/platform/WebVector.h" | ||
|
||
#if WEB_DISPLAY_ITEM_LIST_IS_DEFINED | ||
#include "third_party/WebKit/public/platform/WebDisplayItemList.h" | ||
#endif | ||
|
||
class SkImageFilter; | ||
class SkMatrix44; | ||
class SkPicture; | ||
class SkRRect; | ||
|
||
namespace cc_blink { | ||
|
||
#if WEB_DISPLAY_ITEM_LIST_IS_DEFINED | ||
class WebDisplayItemListImpl : public blink::WebDisplayItemList { | ||
#else | ||
class WebDisplayItemListImpl { | ||
#endif | ||
|
||
public: | ||
CC_BLINK_EXPORT WebDisplayItemListImpl(); | ||
virtual ~WebDisplayItemListImpl(); | ||
|
||
scoped_refptr<cc::DisplayItemList> ToDisplayItemList(); | ||
|
||
// blink::WebDisplayItemList implementation. | ||
virtual void appendDrawingItem(SkPicture* picture, | ||
const blink::WebFloatPoint& location); | ||
virtual void appendClipItem( | ||
const blink::WebRect& clip_rect, | ||
const blink::WebVector<SkRRect>& rounded_clip_rects); | ||
virtual void appendEndClipItem(); | ||
virtual void appendTransformItem(const SkMatrix44& matrix); | ||
virtual void appendEndTransformItem(); | ||
virtual void appendTransparencyItem(float opacity, | ||
blink::WebBlendMode blend_mode); | ||
virtual void appendEndTransparencyItem(); | ||
virtual void appendFilterItem(SkImageFilter* filter, | ||
const blink::WebFloatRect& bounds); | ||
virtual void appendEndFilterItem(); | ||
|
||
private: | ||
scoped_refptr<cc::DisplayItemList> display_item_list_; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(WebDisplayItemListImpl); | ||
}; | ||
|
||
} // namespace cc_blink | ||
|
||
#endif // CC_BLINK_WEB_DISPLAY_ITEM_LIST_IMPL_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.