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

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

Issue 210413003: Drop software resources sent to a GL delegated renderer. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/resource_provider.h" 5 #include "cc/resources/resource_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 1389
1390 if ((!it->is_software && !gl) || 1390 if ((!it->is_software && !gl) ||
1391 (it->is_software && !shared_bitmap_manager_)) { 1391 (it->is_software && !shared_bitmap_manager_)) {
1392 TRACE_EVENT0("cc", "ResourceProvider::ReceiveFromChild dropping invalid"); 1392 TRACE_EVENT0("cc", "ResourceProvider::ReceiveFromChild dropping invalid");
1393 ReturnedResourceArray to_return; 1393 ReturnedResourceArray to_return;
1394 to_return.push_back(it->ToReturnedResource()); 1394 to_return.push_back(it->ToReturnedResource());
1395 child_info.return_callback.Run(to_return); 1395 child_info.return_callback.Run(to_return);
1396 continue; 1396 continue;
1397 } 1397 }
1398 1398
1399 if (it->is_software && gl) {
1400 TRACE_EVENT0(
1401 "cc",
1402 "ResourceProvider::ReceiveFromChild dropping software resource");
1403 ReturnedResourceArray to_return;
1404 to_return.push_back(it->ToReturnedResource());
1405 child_info.return_callback.Run(to_return);
1406 continue;
1407 }
1408
1399 ResourceId local_id = next_id_++; 1409 ResourceId local_id = next_id_++;
1400 Resource& resource = resources_[local_id]; 1410 Resource& resource = resources_[local_id];
1401 if (it->is_software) { 1411 if (it->is_software) {
1402 resource = Resource(it->mailbox_holder.mailbox, 1412 resource = Resource(it->mailbox_holder.mailbox,
1403 it->size, 1413 it->size,
1404 Resource::Delegated, 1414 Resource::Delegated,
1405 GL_LINEAR, 1415 GL_LINEAR,
1406 GL_CLAMP_TO_EDGE); 1416 GL_CLAMP_TO_EDGE);
1407 } else { 1417 } else {
1408 resource = Resource(0, 1418 resource = Resource(0,
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
2215 ContextProvider* context_provider = output_surface_->context_provider(); 2225 ContextProvider* context_provider = output_surface_->context_provider();
2216 return context_provider ? context_provider->ContextGL() : NULL; 2226 return context_provider ? context_provider->ContextGL() : NULL;
2217 } 2227 }
2218 2228
2219 class GrContext* ResourceProvider::GrContext() const { 2229 class GrContext* ResourceProvider::GrContext() const {
2220 ContextProvider* context_provider = output_surface_->context_provider(); 2230 ContextProvider* context_provider = output_surface_->context_provider();
2221 return context_provider ? context_provider->GrContext() : NULL; 2231 return context_provider ? context_provider->GrContext() : NULL;
2222 } 2232 }
2223 2233
2224 } // namespace cc 2234 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/resource_provider_unittest.cc » ('j') | cc/resources/resource_provider_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698