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

Side by Side Diff: cc/blink/web_external_texture_layer_impl.cc

Issue 812543002: Update from https://crrev.com/308331 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « cc/blink/web_external_bitmap_impl.cc ('k') | cc/blink/web_image_layer_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/blink/web_external_texture_layer_impl.h" 5 #include "cc/blink/web_external_texture_layer_impl.h"
6 6
7 #include "cc/blink/web_external_bitmap_impl.h" 7 #include "cc/blink/web_external_bitmap_impl.h"
8 #include "cc/blink/web_layer_impl.h" 8 #include "cc/blink/web_layer_impl.h"
9 #include "cc/layers/texture_layer.h" 9 #include "cc/layers/texture_layer.h"
10 #include "cc/resources/resource_update_queue.h" 10 #include "cc/resources/resource_update_queue.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 if (use_shared_memory) 77 if (use_shared_memory)
78 bitmap = AllocateBitmap(); 78 bitmap = AllocateBitmap();
79 if (!client_->prepareMailbox(&client_mailbox, bitmap)) { 79 if (!client_->prepareMailbox(&client_mailbox, bitmap)) {
80 if (bitmap) 80 if (bitmap)
81 free_bitmaps_.push_back(bitmap); 81 free_bitmaps_.push_back(bitmap);
82 return false; 82 return false;
83 } 83 }
84 gpu::Mailbox name; 84 gpu::Mailbox name;
85 name.SetName(client_mailbox.name); 85 name.SetName(client_mailbox.name);
86 if (bitmap) { 86 if (bitmap) {
87 *mailbox = cc::TextureMailbox(bitmap->shared_memory(), bitmap->size()); 87 *mailbox = cc::TextureMailbox(bitmap->shared_bitmap(), bitmap->size());
88 } else { 88 } else {
89 *mailbox = 89 *mailbox =
90 cc::TextureMailbox(name, GL_TEXTURE_2D, client_mailbox.syncPoint); 90 cc::TextureMailbox(name, GL_TEXTURE_2D, client_mailbox.syncPoint);
91 } 91 }
92 mailbox->set_allow_overlay(client_mailbox.allowOverlay); 92 mailbox->set_allow_overlay(client_mailbox.allowOverlay);
93 mailbox->set_nearest_neighbor(client_mailbox.nearestNeighbor); 93 mailbox->set_nearest_neighbor(client_mailbox.nearestNeighbor);
94 94
95 if (mailbox->IsValid()) { 95 if (mailbox->IsValid()) {
96 *release_callback = cc::SingleReleaseCallback::Create( 96 *release_callback = cc::SingleReleaseCallback::Create(
97 base::Bind(&WebExternalTextureLayerImpl::DidReleaseMailbox, 97 base::Bind(&WebExternalTextureLayerImpl::DidReleaseMailbox,
(...skipping 24 matching lines...) Expand all
122 DCHECK(layer); 122 DCHECK(layer);
123 blink::WebExternalTextureMailbox available_mailbox; 123 blink::WebExternalTextureMailbox available_mailbox;
124 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); 124 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name));
125 available_mailbox.syncPoint = sync_point; 125 available_mailbox.syncPoint = sync_point;
126 if (bitmap) 126 if (bitmap)
127 layer->free_bitmaps_.push_back(bitmap); 127 layer->free_bitmaps_.push_back(bitmap);
128 layer->client_->mailboxReleased(available_mailbox, lost_resource); 128 layer->client_->mailboxReleased(available_mailbox, lost_resource);
129 } 129 }
130 130
131 } // namespace cc_blink 131 } // namespace cc_blink
OLDNEW
« no previous file with comments | « cc/blink/web_external_bitmap_impl.cc ('k') | cc/blink/web_image_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698