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

Side by Side Diff: cc/resource_update_controller.cc

Issue 11622008: cc: Defer texture allocation (to allow async allocations). (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase. Rebase test fixes. Created 7 years, 11 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/resource_provider_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 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_update_controller.h" 5 #include "cc/resource_update_controller.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "cc/prioritized_resource.h" 10 #include "cc/prioritized_resource.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 WebSharedGraphicsContext3D::compositorThreadContext() : 134 WebSharedGraphicsContext3D::compositorThreadContext() :
135 WebSharedGraphicsContext3D::mainThreadContext(); 135 WebSharedGraphicsContext3D::mainThreadContext();
136 GrContext* paintGrContext = m_hasImplThread ? 136 GrContext* paintGrContext = m_hasImplThread ?
137 WebSharedGraphicsContext3D::compositorThreadGrContext() : 137 WebSharedGraphicsContext3D::compositorThreadGrContext() :
138 WebSharedGraphicsContext3D::mainThreadGrContext(); 138 WebSharedGraphicsContext3D::mainThreadGrContext();
139 139
140 // Flush the context in which the backing texture is created so that it 140 // Flush the context in which the backing texture is created so that it
141 // is available in other shared contexts. It is important to do here 141 // is available in other shared contexts. It is important to do here
142 // because the backing texture is created in one context while it is 142 // because the backing texture is created in one context while it is
143 // being written to in another. 143 // being written to in another.
144 m_resourceProvider->flush();
145 ResourceProvider::ScopedWriteLockGL lock( 144 ResourceProvider::ScopedWriteLockGL lock(
146 m_resourceProvider, texture->resourceId()); 145 m_resourceProvider, texture->resourceId());
146 m_resourceProvider->flush();
147 147
148 // Make sure ganesh uses the correct GL context. 148 // Make sure ganesh uses the correct GL context.
149 paintContext->makeContextCurrent(); 149 paintContext->makeContextCurrent();
150 150
151 // Create an accelerated canvas to draw on. 151 // Create an accelerated canvas to draw on.
152 skia::RefPtr<SkCanvas> canvas = createAcceleratedCanvas( 152 skia::RefPtr<SkCanvas> canvas = createAcceleratedCanvas(
153 paintGrContext, texture->size(), lock.textureId()); 153 paintGrContext, texture->size(), lock.textureId());
154 154
155 // The compositor expects the textures to be upside-down so it can flip 155 // The compositor expects the textures to be upside-down so it can flip
156 // the final composited image. Ganesh renders the image upright so we 156 // the final composited image. Ganesh renders the image upright so we
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 if (!uploads) 283 if (!uploads)
284 return; 284 return;
285 285
286 while (m_queue->fullUploadSize() && uploads--) 286 while (m_queue->fullUploadSize() && uploads--)
287 updateTexture(m_queue->takeFirstFullUpload()); 287 updateTexture(m_queue->takeFirstFullUpload());
288 288
289 m_resourceProvider->flushUploads(); 289 m_resourceProvider->flushUploads();
290 } 290 }
291 291
292 } // namespace cc 292 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resource_provider_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