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

Side by Side Diff: cc/resource_provider.cc

Issue 11824040: Enables compositing support for webview. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed build error on mac and win, nits 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 | « no previous file | content/common/gpu/image_transport_surface_linux.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_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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 const int8* name = reinterpret_cast<const int8*>(mailbox.data()); 250 const int8* name = reinterpret_cast<const int8*>(mailbox.data());
251 WebGraphicsContext3D* context3d = m_outputSurface->Context3D(); 251 WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
252 DCHECK(context3d); 252 DCHECK(context3d);
253 unsigned textureId = context3d->createTexture(); 253 unsigned textureId = context3d->createTexture();
254 GLC(context3d, context3d->bindTexture(GL_TEXTURE_2D, textureId)); 254 GLC(context3d, context3d->bindTexture(GL_TEXTURE_2D, textureId));
255 GLC(context3d, context3d->consumeTextureCHROMIUM(GL_TEXTURE_2D, name)); 255 GLC(context3d, context3d->consumeTextureCHROMIUM(GL_TEXTURE_2D, name));
256 256
257 ResourceId id = m_nextId++; 257 ResourceId id = m_nextId++;
258 Resource resource(textureId, gfx::Size(), 0, GL_LINEAR); 258 Resource resource(textureId, gfx::Size(), 0, GL_LINEAR);
259 resource.external = true; 259 resource.external = true;
260 resource.allocated = true;
260 resource.mailbox.setName(name); 261 resource.mailbox.setName(name);
261 resource.mailboxReleaseCallback = releaseCallback; 262 resource.mailboxReleaseCallback = releaseCallback;
262 m_resources[id] = resource; 263 m_resources[id] = resource;
263 return id; 264 return id;
264 } 265 }
265 266
266 void ResourceProvider::deleteResource(ResourceId id) 267 void ResourceProvider::deleteResource(ResourceId id)
267 { 268 {
268 DCHECK(m_threadChecker.CalledOnValidThread()); 269 DCHECK(m_threadChecker.CalledOnValidThread());
269 ResourceMap::iterator it = m_resources.find(id); 270 ResourceMap::iterator it = m_resources.find(id);
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 GLC(context3d, context3d->bindTexture(GL_TEXTURE_2D, resource->glId)); 1043 GLC(context3d, context3d->bindTexture(GL_TEXTURE_2D, resource->glId));
1043 if (m_useTextureStorageExt && isTextureFormatSupportedForStorage(format)) { 1044 if (m_useTextureStorageExt && isTextureFormatSupportedForStorage(format)) {
1044 GLenum storageFormat = textureToStorageFormat(format); 1045 GLenum storageFormat = textureToStorageFormat(format);
1045 GLC(context3d, context3d->texStorage2DEXT(GL_TEXTURE_2D, 1, storageForma t, size.width(), size.height())); 1046 GLC(context3d, context3d->texStorage2DEXT(GL_TEXTURE_2D, 1, storageForma t, size.width(), size.height()));
1046 } else 1047 } else
1047 GLC(context3d, context3d->texImage2D(GL_TEXTURE_2D, 0, format, size.widt h(), size.height(), 0, format, GL_UNSIGNED_BYTE, 0)); 1048 GLC(context3d, context3d->texImage2D(GL_TEXTURE_2D, 0, format, size.widt h(), size.height(), 0, format, GL_UNSIGNED_BYTE, 0));
1048 } 1049 }
1049 1050
1050 1051
1051 } // namespace cc 1052 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/image_transport_surface_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698