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

Side by Side Diff: cc/texture_update_controller.cc

Issue 11232051: Remove static thread pointers from CC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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
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 "config.h" 5 #include "config.h"
6 6
7 #include "cc/texture_update_controller.h" 7 #include "cc/texture_update_controller.h"
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "cc/prioritized_texture.h" 10 #include "cc/prioritized_texture.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 IntRect pictureRect = update.content_rect; 119 IntRect pictureRect = update.content_rect;
120 IntRect sourceRect = update.source_rect; 120 IntRect sourceRect = update.source_rect;
121 IntSize destOffset = update.dest_offset; 121 IntSize destOffset = update.dest_offset;
122 122
123 texture->acquireBackingTexture(m_resourceProvider); 123 texture->acquireBackingTexture(m_resourceProvider);
124 DCHECK(texture->haveBackingTexture()); 124 DCHECK(texture->haveBackingTexture());
125 125
126 DCHECK(m_resourceProvider->resourceType(texture->resourceId()) == 126 DCHECK(m_resourceProvider->resourceType(texture->resourceId()) ==
127 CCResourceProvider::GLTexture); 127 CCResourceProvider::GLTexture);
128 128
129 WebGraphicsContext3D* paintContext = CCProxy::hasImplThread() ? 129 bool hasImplThread = m_resourceProvider->proxy()->hasImplThread();
130 WebGraphicsContext3D* paintContext = hasImplThread ?
130 WebSharedGraphicsContext3D::compositorThreadContext() : 131 WebSharedGraphicsContext3D::compositorThreadContext() :
131 WebSharedGraphicsContext3D::mainThreadContext(); 132 WebSharedGraphicsContext3D::mainThreadContext();
132 GrContext* paintGrContext = CCProxy::hasImplThread() ? 133 GrContext* paintGrContext = hasImplThread ?
133 WebSharedGraphicsContext3D::compositorThreadGrContext() : 134 WebSharedGraphicsContext3D::compositorThreadGrContext() :
134 WebSharedGraphicsContext3D::mainThreadGrContext(); 135 WebSharedGraphicsContext3D::mainThreadGrContext();
135 136
136 // Flush the context in which the backing texture is created so that it 137 // Flush the context in which the backing texture is created so that it
137 // is available in other shared contexts. It is important to do here 138 // is available in other shared contexts. It is important to do here
138 // because the backing texture is created in one context while it is 139 // because the backing texture is created in one context while it is
139 // being written to in another. 140 // being written to in another.
140 m_resourceProvider->flush(); 141 m_resourceProvider->flush();
141 CCResourceProvider::ScopedWriteLockGL lock( 142 CCResourceProvider::ScopedWriteLockGL lock(
142 m_resourceProvider, texture->resourceId()); 143 m_resourceProvider, texture->resourceId());
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 while (m_queue->fullUploadSize() && uploadCount < uploads) { 284 while (m_queue->fullUploadSize() && uploadCount < uploads) {
284 if (!(uploadCount % textureUploadFlushPeriod) && uploadCount) 285 if (!(uploadCount % textureUploadFlushPeriod) && uploadCount)
285 m_resourceProvider->shallowFlushIfSupported(); 286 m_resourceProvider->shallowFlushIfSupported();
286 updateTexture(m_queue->takeFirstFullUpload()); 287 updateTexture(m_queue->takeFirstFullUpload());
287 uploadCount++; 288 uploadCount++;
288 } 289 }
289 m_resourceProvider->shallowFlushIfSupported(); 290 m_resourceProvider->shallowFlushIfSupported();
290 } 291 }
291 292
292 } // namespace cc 293 } // namespace cc
OLDNEW
« cc/proxy.h ('K') | « cc/software_renderer.cc ('k') | cc/thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698