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

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

Issue 148003006: Use gpu::Mailbox instead of std:string in IPCs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed typo 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: content/common/gpu/texture_image_transport_surface.cc
diff --git a/content/common/gpu/texture_image_transport_surface.cc b/content/common/gpu/texture_image_transport_surface.cc
index f13a9865e2f6d6ae948ad7e640a518894e47573c..3a1ad192a72c402d82069e923abea1eb138ee34e 100644
--- a/content/common/gpu/texture_image_transport_surface.cc
+++ b/content/common/gpu/texture_image_transport_surface.cc
@@ -218,9 +218,7 @@ bool TextureImageTransportSurface::SwapBuffers() {
GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params;
params.size = backbuffer_size();
params.scale_factor = scale_factor_;
- params.mailbox_name.assign(
- reinterpret_cast<const char*>(&back_mailbox_),
- sizeof(back_mailbox_));
+ params.mailbox = back_mailbox_;
glFlush();
@@ -258,9 +256,7 @@ bool TextureImageTransportSurface::PostSubBuffer(
params.y = y;
params.width = width;
params.height = height;
- params.mailbox_name.assign(
- reinterpret_cast<const char*>(&back_mailbox_),
- sizeof(back_mailbox_));
+ params.mailbox = back_mailbox_;
glFlush();
@@ -294,18 +290,17 @@ unsigned TextureImageTransportSurface::GetFormat() {
void TextureImageTransportSurface::OnBufferPresented(
const AcceleratedSurfaceMsg_BufferPresented_Params& params) {
if (params.sync_point == 0) {
- BufferPresentedImpl(params.mailbox_name);
+ BufferPresentedImpl(params.mailbox);
} else {
helper_->manager()->sync_point_manager()->AddSyncPointCallback(
params.sync_point,
base::Bind(&TextureImageTransportSurface::BufferPresentedImpl,
this,
- params.mailbox_name));
+ params.mailbox));
}
}
-void TextureImageTransportSurface::BufferPresentedImpl(
- const std::string& mailbox_name) {
+void TextureImageTransportSurface::BufferPresentedImpl(const Mailbox& mailbox) {
DCHECK(is_swap_buffers_pending_);
is_swap_buffers_pending_ = false;
@@ -321,11 +316,8 @@ void TextureImageTransportSurface::BufferPresentedImpl(
DCHECK(backbuffer_.get());
bool swap = true;
- if (!mailbox_name.empty()) {
- DCHECK(mailbox_name.length() == GL_MAILBOX_SIZE_CHROMIUM);
- if (!memcmp(mailbox_name.data(),
- &back_mailbox_,
- mailbox_name.length())) {
+ if (!mailbox.IsZero()) {
+ if (mailbox == back_mailbox_) {
// 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;
« no previous file with comments | « content/common/gpu/texture_image_transport_surface.h ('k') | content/renderer/browser_plugin/browser_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698