Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: trunk/src/content/common/gpu/texture_image_transport_surface.cc

Issue 163433008: Revert 251207 "Use gpu::Mailbox instead of std:string in IPCs" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/content/common/gpu/texture_image_transport_surface.cc
===================================================================
--- trunk/src/content/common/gpu/texture_image_transport_surface.cc (revision 251280)
+++ trunk/src/content/common/gpu/texture_image_transport_surface.cc (working copy)
@@ -218,7 +218,9 @@
GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params;
params.size = backbuffer_size();
params.scale_factor = scale_factor_;
- params.mailbox = back_mailbox_;
+ params.mailbox_name.assign(
+ reinterpret_cast<const char*>(&back_mailbox_),
+ sizeof(back_mailbox_));
glFlush();
@@ -256,7 +258,9 @@
params.y = y;
params.width = width;
params.height = height;
- params.mailbox = back_mailbox_;
+ params.mailbox_name.assign(
+ reinterpret_cast<const char*>(&back_mailbox_),
+ sizeof(back_mailbox_));
glFlush();
@@ -290,17 +294,18 @@
void TextureImageTransportSurface::OnBufferPresented(
const AcceleratedSurfaceMsg_BufferPresented_Params& params) {
if (params.sync_point == 0) {
- BufferPresentedImpl(params.mailbox);
+ BufferPresentedImpl(params.mailbox_name);
} else {
helper_->manager()->sync_point_manager()->AddSyncPointCallback(
params.sync_point,
base::Bind(&TextureImageTransportSurface::BufferPresentedImpl,
this,
- params.mailbox));
+ params.mailbox_name));
}
}
-void TextureImageTransportSurface::BufferPresentedImpl(const Mailbox& mailbox) {
+void TextureImageTransportSurface::BufferPresentedImpl(
+ const std::string& mailbox_name) {
DCHECK(is_swap_buffers_pending_);
is_swap_buffers_pending_ = false;
@@ -316,8 +321,11 @@
DCHECK(backbuffer_.get());
bool swap = true;
- if (!mailbox.IsZero()) {
- if (mailbox != back_mailbox_) {
+ if (!mailbox_name.empty()) {
+ DCHECK(mailbox_name.length() == GL_MAILBOX_SIZE_CHROMIUM);
+ if (!memcmp(mailbox_name.data(),
+ &back_mailbox_,
+ mailbox_name.length())) {
// The browser has skipped the frame to unblock the GPU process, waiting
// for one of the right size, and returned the back buffer, so don't swap.
swap = false;

Powered by Google App Engine
This is Rietveld 408576698