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

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: Android build 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"
11 #include "base/stl_util.h" 11 #include "base/stl_util.h"
12 #include "base/string_split.h" 12 #include "base/string_split.h"
13 #include "base/string_util.h" 13 #include "base/string_util.h"
14 #include "cc/gl_renderer.h" // For the GLC() macro. 14 #include "cc/gl_renderer.h" // For the GLC() macro.
15 #include "cc/platform_color.h" 15 #include "cc/platform_color.h"
16 #include "cc/texture_uploader.h" 16 #include "cc/texture_uploader.h"
17 #include "cc/transferable_resource.h" 17 #include "cc/transferable_resource.h"
18 #include "gpu/GLES2/gl2extchromium.h" 18 #include "gpu/GLES2/gl2extchromium.h"
19 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h" 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h"
20 #include "third_party/khronos/GLES2/gl2.h" 20 #include "third_party/khronos/GLES2/gl2.h"
21 #include "third_party/khronos/GLES2/gl2ext.h" 21 #include "third_party/khronos/GLES2/gl2ext.h"
22 #include "ui/gfx/rect.h" 22 #include "ui/gfx/rect.h"
23 #include "ui/gfx/vector2d.h" 23 #include "ui/gfx/vector2d.h"
24 #include "ui/gl/context_provider.h"
24 25
25 using WebKit::WebGraphicsContext3D; 26 using WebKit::WebGraphicsContext3D;
26 27
27 namespace cc { 28 namespace cc {
28 29
29 static GLenum textureToStorageFormat(GLenum textureFormat) 30 static GLenum textureToStorageFormat(GLenum textureFormat)
30 { 31 {
31 GLenum storageFormat = GL_RGBA8_OES; 32 GLenum storageFormat = GL_RGBA8_OES;
32 switch (textureFormat) { 33 switch (textureFormat) {
33 case GL_RGBA: 34 case GL_RGBA:
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 } 1118 }
1118 1119
1119 void ResourceProvider::enableReadLockFences(ResourceProvider::ResourceId id, boo l enable) { 1120 void ResourceProvider::enableReadLockFences(ResourceProvider::ResourceId id, boo l enable) {
1120 DCHECK(m_threadChecker.CalledOnValidThread()); 1121 DCHECK(m_threadChecker.CalledOnValidThread());
1121 ResourceMap::iterator it = m_resources.find(id); 1122 ResourceMap::iterator it = m_resources.find(id);
1122 CHECK(it != m_resources.end()); 1123 CHECK(it != m_resources.end());
1123 Resource* resource = &it->second; 1124 Resource* resource = &it->second;
1124 resource->enableReadLockFences = enable; 1125 resource->enableReadLockFences = enable;
1125 } 1126 }
1126 1127
1128 void ResourceProvider::setOffscreenContextProvider(scoped_refptr<ui::ContextProv ider> offscreenContextProvider) {
1129 if (offscreenContextProvider)
1130 offscreenContextProvider->BindToCurrentThread();
1131 m_offscreenContextProvider = offscreenContextProvider;
1132 }
1133
1127 } // namespace cc 1134 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698