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

Side by Side Diff: cc/scheduler/texture_uploader.h

Issue 147603006: [#7] Resubmitted - Pass gfx structs by const ref (gfx::Size) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resubmit 145313006 Created 6 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
« no previous file with comments | « cc/resources/video_resource_updater.cc ('k') | cc/scheduler/texture_uploader.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 #ifndef CC_SCHEDULER_TEXTURE_UPLOADER_H_ 5 #ifndef CC_SCHEDULER_TEXTURE_UPLOADER_H_
6 #define CC_SCHEDULER_TEXTURE_UPLOADER_H_ 6 #define CC_SCHEDULER_TEXTURE_UPLOADER_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 29 matching lines...) Expand all
40 40
41 // Let content_rect be a rectangle, and let content_rect be a sub-rectangle of 41 // Let content_rect be a rectangle, and let content_rect be a sub-rectangle of
42 // content_rect, expressed in the same coordinate system as content_rect. Let 42 // content_rect, expressed in the same coordinate system as content_rect. Let
43 // image be a buffer for content_rect. This function will copy the region 43 // image be a buffer for content_rect. This function will copy the region
44 // corresponding to source_rect to dest_offset in this sub-image. 44 // corresponding to source_rect to dest_offset in this sub-image.
45 void Upload(const uint8* image, 45 void Upload(const uint8* image,
46 const gfx::Rect& content_rect, 46 const gfx::Rect& content_rect,
47 const gfx::Rect& source_rect, 47 const gfx::Rect& source_rect,
48 gfx::Vector2d dest_offset, 48 gfx::Vector2d dest_offset,
49 ResourceFormat format, 49 ResourceFormat format,
50 gfx::Size size); 50 const gfx::Size& size);
51 51
52 void Flush(); 52 void Flush();
53 void ReleaseCachedQueries(); 53 void ReleaseCachedQueries();
54 54
55 private: 55 private:
56 class Query { 56 class Query {
57 public: 57 public:
58 static scoped_ptr<Query> Create(gpu::gles2::GLES2Interface* gl) { 58 static scoped_ptr<Query> Create(gpu::gles2::GLES2Interface* gl) {
59 return make_scoped_ptr(new Query(gl)); 59 return make_scoped_ptr(new Query(gl));
60 } 60 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 void UploadWithTexSubImage(const uint8* image, 94 void UploadWithTexSubImage(const uint8* image,
95 const gfx::Rect& image_rect, 95 const gfx::Rect& image_rect,
96 const gfx::Rect& source_rect, 96 const gfx::Rect& source_rect,
97 gfx::Vector2d dest_offset, 97 gfx::Vector2d dest_offset,
98 ResourceFormat format); 98 ResourceFormat format);
99 void UploadWithMapTexSubImage(const uint8* image, 99 void UploadWithMapTexSubImage(const uint8* image,
100 const gfx::Rect& image_rect, 100 const gfx::Rect& image_rect,
101 const gfx::Rect& source_rect, 101 const gfx::Rect& source_rect,
102 gfx::Vector2d dest_offset, 102 gfx::Vector2d dest_offset,
103 ResourceFormat format); 103 ResourceFormat format);
104 void UploadWithTexImageETC1(const uint8* image, gfx::Size size); 104 void UploadWithTexImageETC1(const uint8* image, const gfx::Size& size);
105 105
106 gpu::gles2::GLES2Interface* gl_; 106 gpu::gles2::GLES2Interface* gl_;
107 ScopedPtrDeque<Query> pending_queries_; 107 ScopedPtrDeque<Query> pending_queries_;
108 ScopedPtrDeque<Query> available_queries_; 108 ScopedPtrDeque<Query> available_queries_;
109 std::multiset<double> textures_per_second_history_; 109 std::multiset<double> textures_per_second_history_;
110 size_t num_blocking_texture_uploads_; 110 size_t num_blocking_texture_uploads_;
111 111
112 size_t sub_image_size_; 112 size_t sub_image_size_;
113 scoped_ptr<uint8[]> sub_image_; 113 scoped_ptr<uint8[]> sub_image_;
114 114
115 size_t num_texture_uploads_since_last_flush_; 115 size_t num_texture_uploads_since_last_flush_;
116 116
117 DISALLOW_COPY_AND_ASSIGN(TextureUploader); 117 DISALLOW_COPY_AND_ASSIGN(TextureUploader);
118 }; 118 };
119 119
120 } // namespace cc 120 } // namespace cc
121 121
122 #endif // CC_SCHEDULER_TEXTURE_UPLOADER_H_ 122 #endif // CC_SCHEDULER_TEXTURE_UPLOADER_H_
OLDNEW
« no previous file with comments | « cc/resources/video_resource_updater.cc ('k') | cc/scheduler/texture_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698