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

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: Rebase 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 | 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 <deque>
9 #include <string>
10 #include <vector>
11
8 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/callback.h"
9 #include "base/hash_tables.h" 14 #include "base/hash_tables.h"
10 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
11 #include "base/threading/thread_checker.h" 16 #include "base/threading/thread_checker.h"
12 #include "cc/cc_export.h" 17 #include "cc/cc_export.h"
13 #include "cc/output_surface.h" 18 #include "cc/output_surface.h"
14 #include "cc/texture_copier.h" 19 #include "cc/texture_copier.h"
15 #include "cc/transferable_resource.h" 20 #include "cc/transferable_resource.h"
16 #include "third_party/khronos/GLES2/gl2.h" 21 #include "third_party/khronos/GLES2/gl2.h"
17 #include "third_party/skia/include/core/SkBitmap.h" 22 #include "third_party/skia/include/core/SkBitmap.h"
18 #include "third_party/skia/include/core/SkCanvas.h" 23 #include "third_party/skia/include/core/SkCanvas.h"
19 #include "ui/gfx/size.h" 24 #include "ui/gfx/size.h"
20 #include <deque>
21 #include <vector>
22 25
23 namespace WebKit { 26 namespace WebKit {
24 class WebGraphicsContext3D; 27 class WebGraphicsContext3D;
25 } 28 }
26 29
27 namespace gfx { 30 namespace gfx {
28 class Rect; 31 class Rect;
29 class Vector2d; 32 class Vector2d;
30 } 33 }
31 34
(...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. 78 // 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); 79 ResourceId createManagedResource(const gfx::Size&, GLenum format, TextureUsa geHint);
77 80
78 // You can also explicitly create a specific resource type. 81 // You can also explicitly create a specific resource type.
79 ResourceId createGLTexture(const gfx::Size&, GLenum format, GLenum texturePo ol, TextureUsageHint); 82 ResourceId createGLTexture(const gfx::Size&, GLenum format, GLenum texturePo ol, TextureUsageHint);
80 83
81 ResourceId createBitmap(const gfx::Size&); 84 ResourceId createBitmap(const gfx::Size&);
82 // Wraps an external texture into a GL resource. 85 // Wraps an external texture into a GL resource.
83 ResourceId createResourceFromExternalTexture(unsigned textureId); 86 ResourceId createResourceFromExternalTexture(unsigned textureId);
84 87
88 // Wraps an external texture mailbox into a GL resource.
89 ResourceId createResourceFromTextureMailbox(const std::string& mailboxName, const base::Callback<void(unsigned)>& releaseCallback);
jamesr 2013/01/07 21:11:49 this is what I was talking about. ResourceProvide
alexst (slow to review) 2013/01/07 21:38:47 I agree it would look better. Maybe splitting the
90
85 void deleteResource(ResourceId); 91 void deleteResource(ResourceId);
86 92
87 // Update pixels from image, copying sourceRect (in image) into destRect (in the resource). 93 // 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); 94 void setPixels(ResourceId, const uint8_t* image, const gfx::Rect& imageRect, const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset);
89 95
90 // Check upload status. 96 // Check upload status.
91 size_t numBlockingUploads(); 97 size_t numBlockingUploads();
92 void markPendingUploadsAsNonBlocking(); 98 void markPendingUploadsAsNonBlocking();
93 double estimatedUploadsPerSecond(); 99 double estimatedUploadsPerSecond();
94 void flushUploads(); 100 void flushUploads();
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 GLenum m_bestTextureFormat; 300 GLenum m_bestTextureFormat;
295 301
296 base::ThreadChecker m_threadChecker; 302 base::ThreadChecker m_threadChecker;
297 303
298 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); 304 DISALLOW_COPY_AND_ASSIGN(ResourceProvider);
299 }; 305 };
300 306
301 } 307 }
302 308
303 #endif // CC_RESOURCE_PROVIDER_H_ 309 #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