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

Side by Side Diff: cc/resource_provider.h

Issue 11638028: Mailbox support for texture layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Formatting Created 7 years, 12 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
« no previous file with comments | « no previous file | cc/resource_provider.cc » ('j') | cc/resource_provider.cc » ('J')
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 #ifndef CC_RESOURCE_PROVIDER_H_ 5 #ifndef CC_RESOURCE_PROVIDER_H_
6 #define CC_RESOURCE_PROVIDER_H_ 6 #define CC_RESOURCE_PROVIDER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback.h"
9 #include "base/hash_tables.h" 10 #include "base/hash_tables.h"
10 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
11 #include "base/threading/thread_checker.h" 12 #include "base/threading/thread_checker.h"
12 #include "cc/cc_export.h" 13 #include "cc/cc_export.h"
13 #include "cc/output_surface.h" 14 #include "cc/output_surface.h"
14 #include "cc/texture_copier.h" 15 #include "cc/texture_copier.h"
15 #include "cc/transferable_resource.h" 16 #include "cc/transferable_resource.h"
16 #include "third_party/khronos/GLES2/gl2.h" 17 #include "third_party/khronos/GLES2/gl2.h"
17 #include "third_party/skia/include/core/SkBitmap.h" 18 #include "third_party/skia/include/core/SkBitmap.h"
18 #include "third_party/skia/include/core/SkCanvas.h" 19 #include "third_party/skia/include/core/SkCanvas.h"
19 #include "ui/gfx/size.h" 20 #include "ui/gfx/size.h"
20 #include <deque> 21 #include <deque>
21 #include <vector> 22 #include <vector>
23 #include <string>
danakj 2013/01/02 16:17:22 Stick all the <> headers above the "" headers whil
alexst (slow to review) 2013/01/02 19:31:35 Done.
22 24
23 namespace WebKit { 25 namespace WebKit {
24 class WebGraphicsContext3D; 26 class WebGraphicsContext3D;
25 } 27 }
26 28
27 namespace gfx { 29 namespace gfx {
28 class Rect; 30 class Rect;
29 class Vector2d; 31 class Vector2d;
30 } 32 }
31 33
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // Creates a resource which is tagged as being managed for GPU memory accoun ting purposes. 77 // Creates a resource which is tagged as being managed for GPU memory accoun ting purposes.
76 ResourceId createManagedResource(const gfx::Size&, GLenum format, TextureUsa geHint); 78 ResourceId createManagedResource(const gfx::Size&, GLenum format, TextureUsa geHint);
77 79
78 // You can also explicitly create a specific resource type. 80 // You can also explicitly create a specific resource type.
79 ResourceId createGLTexture(const gfx::Size&, GLenum format, GLenum texturePo ol, TextureUsageHint); 81 ResourceId createGLTexture(const gfx::Size&, GLenum format, GLenum texturePo ol, TextureUsageHint);
80 82
81 ResourceId createBitmap(const gfx::Size&); 83 ResourceId createBitmap(const gfx::Size&);
82 // Wraps an external texture into a GL resource. 84 // Wraps an external texture into a GL resource.
83 ResourceId createResourceFromExternalTexture(unsigned textureId); 85 ResourceId createResourceFromExternalTexture(unsigned textureId);
84 86
87 // Wraps an external texture mailbox into a GL resource.
88 ResourceId createResourceFromTextureMailbox(const std::string& mailboxName, const base::Callback<void(unsigned)>& releaseCallback);
89
85 void deleteResource(ResourceId); 90 void deleteResource(ResourceId);
86 91
87 // Update pixels from image, copying sourceRect (in image) into destRect (in the resource). 92 // Update pixels from image, copying sourceRect (in image) into destRect (in the resource).
88 void setPixels(ResourceId, const uint8_t* image, const gfx::Rect& imageRect, const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset); 93 void setPixels(ResourceId, const uint8_t* image, const gfx::Rect& imageRect, const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset);
89 94
90 // Check upload status. 95 // Check upload status.
91 size_t numBlockingUploads(); 96 size_t numBlockingUploads();
92 void markPendingUploadsAsNonBlocking(); 97 void markPendingUploadsAsNonBlocking();
93 double estimatedUploadsPerSecond(); 98 double estimatedUploadsPerSecond();
94 void flushUploads(); 99 void flushUploads();
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 GLenum m_bestTextureFormat; 299 GLenum m_bestTextureFormat;
295 300
296 base::ThreadChecker m_threadChecker; 301 base::ThreadChecker m_threadChecker;
297 302
298 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); 303 DISALLOW_COPY_AND_ASSIGN(ResourceProvider);
299 }; 304 };
300 305
301 } 306 }
302 307
303 #endif // CC_RESOURCE_PROVIDER_H_ 308 #endif // CC_RESOURCE_PROVIDER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/resource_provider.cc » ('j') | cc/resource_provider.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698