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

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

Issue 1115653002: Pass gfx structs by const ref(gfx::Vector2D/F) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing some build issue Created 5 years, 7 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/layers/layer_impl.h ('k') | cc/resources/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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_TEXTURE_UPLOADER_H_ 5 #ifndef CC_RESOURCES_TEXTURE_UPLOADER_H_
6 #define CC_RESOURCES_TEXTURE_UPLOADER_H_ 6 #define CC_RESOURCES_TEXTURE_UPLOADER_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 27 matching lines...) Expand all
38 void MarkPendingUploadsAsNonBlocking(); 38 void MarkPendingUploadsAsNonBlocking();
39 double EstimatedTexturesPerSecond(); 39 double EstimatedTexturesPerSecond();
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 const gfx::Vector2d& dest_offset,
49 ResourceFormat format, 49 ResourceFormat format,
50 const 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) {
(...skipping 24 matching lines...) Expand all
83 83
84 explicit TextureUploader(gpu::gles2::GLES2Interface* gl); 84 explicit TextureUploader(gpu::gles2::GLES2Interface* gl);
85 85
86 void BeginQuery(); 86 void BeginQuery();
87 void EndQuery(); 87 void EndQuery();
88 void ProcessQueries(); 88 void ProcessQueries();
89 89
90 void UploadWithTexSubImage(const uint8* image, 90 void UploadWithTexSubImage(const uint8* image,
91 const gfx::Rect& image_rect, 91 const gfx::Rect& image_rect,
92 const gfx::Rect& source_rect, 92 const gfx::Rect& source_rect,
93 gfx::Vector2d dest_offset, 93 const gfx::Vector2d& dest_offset,
94 ResourceFormat format); 94 ResourceFormat format);
95 void UploadWithMapTexSubImage(const uint8* image, 95 void UploadWithMapTexSubImage(const uint8* image,
96 const gfx::Rect& image_rect, 96 const gfx::Rect& image_rect,
97 const gfx::Rect& source_rect, 97 const gfx::Rect& source_rect,
98 gfx::Vector2d dest_offset, 98 const gfx::Vector2d& dest_offset,
99 ResourceFormat format); 99 ResourceFormat format);
100 void UploadWithTexImageETC1(const uint8* image, const gfx::Size& size); 100 void UploadWithTexImageETC1(const uint8* image, const gfx::Size& size);
101 101
102 gpu::gles2::GLES2Interface* gl_; 102 gpu::gles2::GLES2Interface* gl_;
103 ScopedPtrDeque<Query> pending_queries_; 103 ScopedPtrDeque<Query> pending_queries_;
104 ScopedPtrDeque<Query> available_queries_; 104 ScopedPtrDeque<Query> available_queries_;
105 std::multiset<double> textures_per_second_history_; 105 std::multiset<double> textures_per_second_history_;
106 size_t num_blocking_texture_uploads_; 106 size_t num_blocking_texture_uploads_;
107 107
108 size_t sub_image_size_; 108 size_t sub_image_size_;
109 scoped_ptr<uint8[]> sub_image_; 109 scoped_ptr<uint8[]> sub_image_;
110 110
111 size_t num_texture_uploads_since_last_flush_; 111 size_t num_texture_uploads_since_last_flush_;
112 112
113 DISALLOW_COPY_AND_ASSIGN(TextureUploader); 113 DISALLOW_COPY_AND_ASSIGN(TextureUploader);
114 }; 114 };
115 115
116 } // namespace cc 116 } // namespace cc
117 117
118 #endif // CC_RESOURCES_TEXTURE_UPLOADER_H_ 118 #endif // CC_RESOURCES_TEXTURE_UPLOADER_H_
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/resources/texture_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698