Commit 9429976d authored by danakj's avatar danakj Committed by Commit Bot

ui: Disallow software-backed TransferableResources in ui::Layer.

The SetTransferableResource path used to be used for renderer compositor
frames, but those go directly to the display compositor now. Instead it
is used in a couple ChromeOS-specific cases: reflector, and rotation
animation, where ChromeOS takes a screenshot and inserts it into
another ui::Compositor.

Since software resources aren't needed, document this in a comment, and
with a DCHECK, and then no need to add SharedBitmapId registration
code.

R=kylechar@chromium.org

Bug: 730660
Change-Id: I1312c4e58a84431bad1d4c5e23432784ccd206fa
Reviewed-on: https://chromium-review.googlesource.com/987113
Commit-Queue: Antoine Labour <piman@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547531}
parent 5956692e
......@@ -721,6 +721,7 @@ void Layer::SetTransferableResource(
DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR);
DCHECK(!resource.mailbox_holder.mailbox.IsZero());
DCHECK(release_callback);
DCHECK(!resource.is_software);
if (!texture_layer_.get()) {
scoped_refptr<cc::TextureLayer> new_layer =
cc::TextureLayer::CreateForMailbox(this);
......
......@@ -293,8 +293,8 @@ class COMPOSITOR_EXPORT Layer : public LayerAnimationDelegate,
const std::string& name() const { return name_; }
void set_name(const std::string& name) { name_ = name; }
// Set new TransferableResource for this layer. Note that |resource| may hold
// a handle for a shared memory resource or a gpu texture.
// Set new TransferableResource for this layer. This method only supports
// a gpu-backed |resource|.
void SetTransferableResource(
const viz::TransferableResource& resource,
std::unique_ptr<viz::SingleReleaseCallback> release_callback,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment