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

Side by Side Diff: cc/resources/resource_provider.h

Issue 13445009: cc: Move video upload to VideoResourceUpdater. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix software compositing Created 7 years, 8 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 #ifndef CC_RESOURCES_RESOURCE_PROVIDER_H_ 5 #ifndef CC_RESOURCES_RESOURCE_PROVIDER_H_
6 #define CC_RESOURCES_RESOURCE_PROVIDER_H_ 6 #define CC_RESOURCES_RESOURCE_PROVIDER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/callback.h" 14 #include "base/callback.h"
15 #include "base/hash_tables.h" 15 #include "base/hash_tables.h"
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
17 #include "base/memory/weak_ptr.h"
17 #include "base/threading/thread_checker.h" 18 #include "base/threading/thread_checker.h"
18 #include "cc/base/cc_export.h" 19 #include "cc/base/cc_export.h"
19 #include "cc/output/context_provider.h" 20 #include "cc/output/context_provider.h"
20 #include "cc/output/output_surface.h" 21 #include "cc/output/output_surface.h"
21 #include "cc/output/texture_copier.h" 22 #include "cc/output/texture_copier.h"
22 #include "cc/resources/texture_mailbox.h" 23 #include "cc/resources/texture_mailbox.h"
23 #include "cc/resources/transferable_resource.h" 24 #include "cc/resources/transferable_resource.h"
24 #include "third_party/khronos/GLES2/gl2.h" 25 #include "third_party/khronos/GLES2/gl2.h"
25 #include "third_party/skia/include/core/SkBitmap.h" 26 #include "third_party/skia/include/core/SkBitmap.h"
26 #include "third_party/skia/include/core/SkCanvas.h" 27 #include "third_party/skia/include/core/SkCanvas.h"
27 #include "ui/gfx/size.h" 28 #include "ui/gfx/size.h"
28 29
29 namespace WebKit { 30 namespace WebKit {
30 class WebGraphicsContext3D; 31 class WebGraphicsContext3D;
31 } 32 }
32 33
33 namespace gfx { 34 namespace gfx {
34 class Rect; 35 class Rect;
35 class Vector2d; 36 class Vector2d;
36 } 37 }
37 38
38 namespace cc { 39 namespace cc {
39 class TextureUploader; 40 class TextureUploader;
40 41
41 // This class is not thread-safe and can only be called from the thread it was 42 // This class is not thread-safe and can only be called from the thread it was
42 // created on (in practice, the impl thread). 43 // created on (in practice, the impl thread). It supports WeakPtr in order to
43 class CC_EXPORT ResourceProvider { 44 // tell when the provider and the context it holds is destroyed and no longer
45 // usable.
46 class CC_EXPORT ResourceProvider
47 : public base::SupportsWeakPtr<ResourceProvider> {
piman 2013/04/08 21:03:47 Will the VideoResourceUpdater outlive the layer? I
danakj 2013/04/08 21:44:56 Removed this as per offline convo. The callback is
44 public: 48 public:
45 typedef unsigned ResourceId; 49 typedef unsigned ResourceId;
46 typedef std::vector<ResourceId> ResourceIdArray; 50 typedef std::vector<ResourceId> ResourceIdArray;
47 typedef std::set<ResourceId> ResourceIdSet; 51 typedef std::set<ResourceId> ResourceIdSet;
48 typedef base::hash_map<ResourceId, ResourceId> ResourceIdMap; 52 typedef base::hash_map<ResourceId, ResourceId> ResourceIdMap;
49 enum TextureUsageHint { 53 enum TextureUsageHint {
50 TextureUsageAny, 54 TextureUsageAny,
51 TextureUsageFramebuffer, 55 TextureUsageFramebuffer,
52 }; 56 };
53 enum ResourceType { 57 enum ResourceType {
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 base::ThreadChecker thread_checker_; 396 base::ThreadChecker thread_checker_;
393 397
394 scoped_refptr<Fence> current_read_lock_fence_; 398 scoped_refptr<Fence> current_read_lock_fence_;
395 399
396 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); 400 DISALLOW_COPY_AND_ASSIGN(ResourceProvider);
397 }; 401 };
398 402
399 } // namespace cc 403 } // namespace cc
400 404
401 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ 405 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698