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

Side by Side Diff: cc/layers/texture_layer_impl.cc

Issue 951673002: Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b" (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « cc/layers/scrollbar_layer_unittest.cc ('k') | cc/layers/video_layer_impl.cc » ('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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/layers/texture_layer_impl.h" 5 #include "cc/layers/texture_layer_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "cc/output/renderer.h" 10 #include "cc/output/renderer.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // Have to upload a copy to a texture for it to be used in a 98 // Have to upload a copy to a texture for it to be used in a
99 // hardware draw. 99 // hardware draw.
100 if (!texture_copy_) 100 if (!texture_copy_)
101 texture_copy_ = ScopedResource::Create(resource_provider); 101 texture_copy_ = ScopedResource::Create(resource_provider);
102 if (texture_copy_->size() != texture_mailbox_.shared_memory_size() || 102 if (texture_copy_->size() != texture_mailbox_.shared_memory_size() ||
103 resource_provider->InUseByConsumer(texture_copy_->id())) 103 resource_provider->InUseByConsumer(texture_copy_->id()))
104 texture_copy_->Free(); 104 texture_copy_->Free();
105 105
106 if (!texture_copy_->id()) { 106 if (!texture_copy_->id()) {
107 texture_copy_->Allocate(texture_mailbox_.shared_memory_size(), 107 texture_copy_->Allocate(texture_mailbox_.shared_memory_size(),
108 ResourceProvider::TEXTURE_HINT_IMMUTABLE, 108 ResourceProvider::TextureHintImmutable,
109 resource_provider->best_texture_format()); 109 resource_provider->best_texture_format());
110 } 110 }
111 111
112 if (texture_copy_->id()) { 112 if (texture_copy_->id()) {
113 std::vector<uint8> swizzled; 113 std::vector<uint8> swizzled;
114 uint8* pixels = texture_mailbox_.shared_bitmap()->pixels(); 114 uint8* pixels = texture_mailbox_.shared_bitmap()->pixels();
115 115
116 if (!PlatformColor::SameComponentOrder(texture_copy_->format())) { 116 if (!PlatformColor::SameComponentOrder(texture_copy_->format())) {
117 // Swizzle colors. This is slow, but should be really uncommon. 117 // Swizzle colors. This is slow, but should be really uncommon.
118 size_t bytes = texture_mailbox_.SharedMemorySizeInBytes(); 118 size_t bytes = texture_mailbox_.SharedMemorySizeInBytes();
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 } else if (external_texture_resource_) { 256 } else if (external_texture_resource_) {
257 DCHECK(!own_mailbox_); 257 DCHECK(!own_mailbox_);
258 ResourceProvider* resource_provider = 258 ResourceProvider* resource_provider =
259 layer_tree_impl()->resource_provider(); 259 layer_tree_impl()->resource_provider();
260 resource_provider->DeleteResource(external_texture_resource_); 260 resource_provider->DeleteResource(external_texture_resource_);
261 external_texture_resource_ = 0; 261 external_texture_resource_ = 0;
262 } 262 }
263 } 263 }
264 264
265 } // namespace cc 265 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/scrollbar_layer_unittest.cc ('k') | cc/layers/video_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698