Skip to content

Commit

Permalink
Pass a sequence number along with the DIB handle when compositing in …
Browse files Browse the repository at this point in the history
…software.

BUG=124671, 161008


Review URL: https://chromiumcodereview.appspot.com/13248003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191301 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
skaslev@chromium.org committed Mar 29, 2013
1 parent 9fcd783 commit d0f4bd1
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 16 deletions.
4 changes: 1 addition & 3 deletions cc/output/compositor_frame_ack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

namespace cc {

CompositorFrameAck::CompositorFrameAck()
: last_content_dib(TransportDIB::DefaultHandleValue()) {
}
CompositorFrameAck::CompositorFrameAck() {}

CompositorFrameAck::~CompositorFrameAck() {}

Expand Down
2 changes: 1 addition & 1 deletion cc/output/compositor_frame_ack.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CC_EXPORT CompositorFrameAck {

TransferableResourceArray resources;
scoped_ptr<GLFrameData> gl_frame_data;
TransportDIB::Handle last_content_dib;
TransportDIB::Id last_dib_id;

private:
DISALLOW_COPY_AND_ASSIGN(CompositorFrameAck);
Expand Down
4 changes: 1 addition & 3 deletions cc/output/software_frame_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

namespace cc {

SoftwareFrameData::SoftwareFrameData()
: content_dib(TransportDIB::DefaultHandleValue()) {
}
SoftwareFrameData::SoftwareFrameData() {}

SoftwareFrameData::~SoftwareFrameData() {}

Expand Down
2 changes: 1 addition & 1 deletion cc/output/software_frame_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CC_EXPORT SoftwareFrameData {

gfx::Size size;
gfx::Rect damage_rect;
TransportDIB::Handle content_dib;
TransportDIB::Id dib_id;
};

} // namespace cc
Expand Down
5 changes: 3 additions & 2 deletions cc/output/software_output_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ SkCanvas* SoftwareOutputDevice::BeginPaint(gfx::Rect damage_rect) {
void SoftwareOutputDevice::EndPaint(SoftwareFrameData* frame_data) {
DCHECK(device_);
if (frame_data) {
frame_data->size = viewport_size_;
frame_data->damage_rect = damage_rect_;
frame_data->content_dib = TransportDIB::DefaultHandleValue();
frame_data->dib_id = TransportDIB::Id();
}
}

Expand All @@ -54,7 +55,7 @@ void SoftwareOutputDevice::Scroll(
NOTIMPLEMENTED();
}

void SoftwareOutputDevice::ReclaimDIB(TransportDIB::Handle handle) {
void SoftwareOutputDevice::ReclaimDIB(const TransportDIB::Id& id) {
NOTIMPLEMENTED();
}

Expand Down
2 changes: 1 addition & 1 deletion cc/output/software_output_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CC_EXPORT SoftwareOutputDevice {
gfx::Rect clip_rect);

// TODO(skaslev) Remove this after UberCompositor lands.
virtual void ReclaimDIB(TransportDIB::Handle handle);
virtual void ReclaimDIB(const TransportDIB::Id& id);

protected:
gfx::Size viewport_size_;
Expand Down
2 changes: 1 addition & 1 deletion cc/output/software_renderer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void SoftwareRenderer::ReceiveCompositorFrameAck(
const CompositorFrameAck& ack) {
if (capabilities_.using_swap_complete_callback)
client_->OnSwapBuffersComplete();
output_device_->ReclaimDIB(ack.last_content_dib);
output_device_->ReclaimDIB(ack.last_dib_id);
}

bool SoftwareRenderer::FlippedFramebuffer() const {
Expand Down
6 changes: 3 additions & 3 deletions content/common/cc_messages.cc
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ void ParamTraits<cc::CompositorFrame>::Log(const param_type& p,
void ParamTraits<cc::CompositorFrameAck>::Write(Message* m,
const param_type& p) {
WriteParam(m, p.resources);
WriteParam(m, p.last_content_dib);
WriteParam(m, p.last_dib_id);
if (p.gl_frame_data) {
WriteParam(m, static_cast<int>(GL_FRAME));
WriteParam(m, *p.gl_frame_data);
Expand All @@ -642,7 +642,7 @@ bool ParamTraits<cc::CompositorFrameAck>::Read(const Message* m,
if (!ReadParam(m, iter, &p->resources))
return false;

if (!ReadParam(m, iter, &p->last_content_dib))
if (!ReadParam(m, iter, &p->last_dib_id))
return false;

int compositor_frame_type;
Expand All @@ -668,7 +668,7 @@ void ParamTraits<cc::CompositorFrameAck>::Log(const param_type& p,
l->append("CompositorFrameAck(");
LogParam(p.resources, l);
l->append(", ");
LogParam(p.last_content_dib, l);
LogParam(p.last_dib_id, l);
l->append(", ");
if (p.gl_frame_data)
LogParam(*p.gl_frame_data, l);
Expand Down
2 changes: 1 addition & 1 deletion content/common/cc_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,5 +239,5 @@ IPC_STRUCT_TRAITS_END()
IPC_STRUCT_TRAITS_BEGIN(cc::SoftwareFrameData)
IPC_STRUCT_TRAITS_MEMBER(size)
IPC_STRUCT_TRAITS_MEMBER(damage_rect)
IPC_STRUCT_TRAITS_MEMBER(content_dib)
IPC_STRUCT_TRAITS_MEMBER(dib_id)
IPC_STRUCT_TRAITS_END()
4 changes: 4 additions & 0 deletions ui/surface/transport_dib.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ class SURFACE_EXPORT TransportDIB {
sequence_num(seq_num) {
}

bool operator==(const HandleAndSequenceNum& other) const {
return other.handle == handle && other.sequence_num == sequence_num;
}

bool operator<(const HandleAndSequenceNum& other) const {
// Use the lexicographic order on the tuple <handle, sequence_num>.
if (other.handle != handle)
Expand Down

0 comments on commit d0f4bd1

Please sign in to comment.