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

Side by Side Diff: cc/resource_provider.cc

Issue 12212007: cc: Route offscreen context creation for compositor to the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove the GrContextProvider::ScopedContexts guard classes Created 7 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 | 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/resource_provider.h" 5 #include "cc/resource_provider.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 8
9 #include "base/debug/alias.h" 9 #include "base/debug/alias.h"
10 #include "base/hash_tables.h" 10 #include "base/hash_tables.h"
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 ResourceProvider::ResourceProvider(OutputSurface* context) 575 ResourceProvider::ResourceProvider(OutputSurface* context)
576 : m_outputSurface(context) 576 : m_outputSurface(context)
577 , m_nextId(1) 577 , m_nextId(1)
578 , m_nextChild(1) 578 , m_nextChild(1)
579 , m_defaultResourceType(GLTexture) 579 , m_defaultResourceType(GLTexture)
580 , m_useTextureStorageExt(false) 580 , m_useTextureStorageExt(false)
581 , m_useTextureUsageHint(false) 581 , m_useTextureUsageHint(false)
582 , m_useShallowFlush(false) 582 , m_useShallowFlush(false)
583 , m_maxTextureSize(0) 583 , m_maxTextureSize(0)
584 , m_bestTextureFormat(0) 584 , m_bestTextureFormat(0)
585 , ALLOW_THIS_IN_INITIALIZER_LIST(m_offscreenContextProvider(this))
585 { 586 {
586 } 587 }
587 588
588 bool ResourceProvider::initialize() 589 bool ResourceProvider::initialize()
589 { 590 {
590 DCHECK(m_threadChecker.CalledOnValidThread()); 591 DCHECK(m_threadChecker.CalledOnValidThread());
591 WebGraphicsContext3D* context3d = m_outputSurface->Context3D(); 592 WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
592 if (!context3d) { 593 if (!context3d) {
593 m_maxTextureSize = INT_MAX / 2; 594 m_maxTextureSize = INT_MAX / 2;
594 m_bestTextureFormat = GL_RGBA; 595 m_bestTextureFormat = GL_RGBA;
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 1111
1111 void ResourceProvider::enableReadLockFences(ResourceProvider::ResourceId id, boo l enable) { 1112 void ResourceProvider::enableReadLockFences(ResourceProvider::ResourceId id, boo l enable) {
1112 DCHECK(m_threadChecker.CalledOnValidThread()); 1113 DCHECK(m_threadChecker.CalledOnValidThread());
1113 ResourceMap::iterator it = m_resources.find(id); 1114 ResourceMap::iterator it = m_resources.find(id);
1114 CHECK(it != m_resources.end()); 1115 CHECK(it != m_resources.end());
1115 Resource* resource = &it->second; 1116 Resource* resource = &it->second;
1116 resource->enableReadLockFences = enable; 1117 resource->enableReadLockFences = enable;
1117 } 1118 }
1118 1119
1119 } // namespace cc 1120 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698