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

Side by Side Diff: cc/resources/video_resource_updater.cc

Issue 486853002: cc: Use a normal texture for background texture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits in unittests Created 6 years, 4 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/resources/scoped_resource_unittest.cc ('k') | cc/test/render_pass_test_common.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/resources/video_resource_updater.h" 5 #include "cc/resources/video_resource_updater.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "cc/output/gl_renderer.h" 9 #include "cc/output/gl_renderer.h"
10 #include "cc/resources/resource_provider.h" 10 #include "cc/resources/resource_provider.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 resource_id = recycled_resources_[i].resource_id; 186 resource_id = recycled_resources_[i].resource_id;
187 mailbox = recycled_resources_[i].mailbox; 187 mailbox = recycled_resources_[i].mailbox;
188 recycled_resources_.erase(recycled_resources_.begin() + i); 188 recycled_resources_.erase(recycled_resources_.begin() + i);
189 break; 189 break;
190 } 190 }
191 } 191 }
192 192
193 if (resource_id == 0) { 193 if (resource_id == 0) {
194 // TODO(danakj): Abstract out hw/sw resource create/delete from 194 // TODO(danakj): Abstract out hw/sw resource create/delete from
195 // ResourceProvider and stop using ResourceProvider in this class. 195 // ResourceProvider and stop using ResourceProvider in this class.
196 resource_id = 196 resource_id = resource_provider_->CreateResource(
197 resource_provider_->CreateResource(output_plane_resource_size, 197 output_plane_resource_size,
198 GL_CLAMP_TO_EDGE, 198 GL_CLAMP_TO_EDGE,
199 ResourceProvider::TextureUsageAny, 199 ResourceProvider::TextureHintImmutable,
200 output_resource_format); 200 output_resource_format);
201 201
202 DCHECK(mailbox.IsZero()); 202 DCHECK(mailbox.IsZero());
203 203
204 if (!software_compositor) { 204 if (!software_compositor) {
205 DCHECK(context_provider_); 205 DCHECK(context_provider_);
206 206
207 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); 207 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL();
208 208
209 GLC(gl, gl->GenMailboxCHROMIUM(mailbox.name)); 209 GLC(gl, gl->GenMailboxCHROMIUM(mailbox.name));
210 ResourceProvider::ScopedWriteLockGL lock(resource_provider_, 210 ResourceProvider::ScopedWriteLockGL lock(resource_provider_,
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 } 392 }
393 393
394 PlaneResource recycled_resource(data.resource_id, 394 PlaneResource recycled_resource(data.resource_id,
395 data.resource_size, 395 data.resource_size,
396 data.resource_format, 396 data.resource_format,
397 data.mailbox); 397 data.mailbox);
398 updater->recycled_resources_.push_back(recycled_resource); 398 updater->recycled_resources_.push_back(recycled_resource);
399 } 399 }
400 400
401 } // namespace cc 401 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/scoped_resource_unittest.cc ('k') | cc/test/render_pass_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698