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

Side by Side Diff: cc/output/gl_renderer.cc

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mock gpu video accelerator factory Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/output/gl_renderer.h" 5 #include "cc/output/gl_renderer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 2684 matching lines...) Expand 10 before | Expand all | Expand 10 after
2695 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 2695 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
2696 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 2696 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
2697 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 2697 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
2698 gl_->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); 2698 gl_->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
2699 } else { 2699 } else {
2700 mailbox = request->texture_mailbox().mailbox(); 2700 mailbox = request->texture_mailbox().mailbox();
2701 DCHECK_EQ(static_cast<unsigned>(GL_TEXTURE_2D), 2701 DCHECK_EQ(static_cast<unsigned>(GL_TEXTURE_2D),
2702 request->texture_mailbox().target()); 2702 request->texture_mailbox().target());
2703 DCHECK(!mailbox.IsZero()); 2703 DCHECK(!mailbox.IsZero());
2704 unsigned incoming_sync_point = request->texture_mailbox().sync_point(); 2704 unsigned incoming_sync_point = request->texture_mailbox().sync_point();
2705 if (incoming_sync_point) 2705 const gpu::SyncToken& incoming_sync_token =
2706 gl_->WaitSyncPointCHROMIUM(incoming_sync_point); 2706 request->texture_mailbox().sync_token();
2707 if (incoming_sync_point || incoming_sync_token.HasData())
2708 gl_->WaitSyncPointCHROMIUM(incoming_sync_point,
2709 incoming_sync_token.GetConstData());
2707 2710
2708 texture_id = 2711 texture_id =
2709 gl_->CreateAndConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); 2712 gl_->CreateAndConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
2710 } 2713 }
2711 GetFramebufferTexture(texture_id, RGBA_8888, window_rect); 2714 GetFramebufferTexture(texture_id, RGBA_8888, window_rect);
2712 2715
2713 unsigned sync_point = gl_->InsertSyncPointCHROMIUM(); 2716 unsigned sync_point = gl_->InsertSyncPointCHROMIUM();
2714 TextureMailbox texture_mailbox(mailbox, GL_TEXTURE_2D, sync_point); 2717 TextureMailbox texture_mailbox(mailbox, GL_TEXTURE_2D, sync_point,
2718 gpu::SyncToken());
2715 2719
2716 scoped_ptr<SingleReleaseCallback> release_callback; 2720 scoped_ptr<SingleReleaseCallback> release_callback;
2717 if (own_mailbox) { 2721 if (own_mailbox) {
2718 gl_->BindTexture(GL_TEXTURE_2D, 0); 2722 gl_->BindTexture(GL_TEXTURE_2D, 0);
2719 release_callback = texture_mailbox_deleter_->GetReleaseCallback( 2723 release_callback = texture_mailbox_deleter_->GetReleaseCallback(
2720 output_surface_->context_provider(), texture_id); 2724 output_surface_->context_provider(), texture_id);
2721 } else { 2725 } else {
2722 gl_->DeleteTextures(1, &texture_id); 2726 gl_->DeleteTextures(1, &texture_id);
2723 } 2727 }
2724 2728
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
3542 texture_id = pending_overlay_resources_.back()->texture_id(); 3546 texture_id = pending_overlay_resources_.back()->texture_id();
3543 } 3547 }
3544 3548
3545 context_support_->ScheduleOverlayPlane( 3549 context_support_->ScheduleOverlayPlane(
3546 overlay.plane_z_order, overlay.transform, texture_id, 3550 overlay.plane_z_order, overlay.transform, texture_id,
3547 ToNearestRect(overlay.display_rect), overlay.uv_rect); 3551 ToNearestRect(overlay.display_rect), overlay.uv_rect);
3548 } 3552 }
3549 } 3553 }
3550 3554
3551 } // namespace cc 3555 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698