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

Side by Side Diff: cc/prioritized_texture.cc

Issue 11368043: cc: Avoid using upload term in relation to resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « cc/prioritized_texture.h ('k') | cc/resource_provider.h » ('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 #include "config.h" 5 #include "config.h"
6 6
7 #include "cc/prioritized_texture.h" 7 #include "cc/prioritized_texture.h"
8 8
9 #include "cc/platform_color.h" 9 #include "cc/platform_color.h"
10 #include "cc/prioritized_texture_manager.h" 10 #include "cc/prioritized_texture_manager.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 m_manager->acquireBackingTextureIfNeeded(this, resourceProvider); 83 m_manager->acquireBackingTextureIfNeeded(this, resourceProvider);
84 } 84 }
85 85
86 ResourceProvider::ResourceId PrioritizedTexture::resourceId() const 86 ResourceProvider::ResourceId PrioritizedTexture::resourceId() const
87 { 87 {
88 if (m_backing) 88 if (m_backing)
89 return m_backing->id(); 89 return m_backing->id();
90 return 0; 90 return 0;
91 } 91 }
92 92
93 void PrioritizedTexture::upload(ResourceProvider* resourceProvider, 93 void PrioritizedTexture::setPixels(ResourceProvider* resourceProvider,
94 const uint8_t* image, const gfx::Rect& imageRect , 94 const uint8_t* image, const gfx::Rect& imageR ect,
95 const gfx::Rect& sourceRect, const gfx::Vector2d & destOffset) 95 const gfx::Rect& sourceRect, const gfx::Vecto r2d& destOffset)
96 { 96 {
97 DCHECK(m_isAbovePriorityCutoff); 97 DCHECK(m_isAbovePriorityCutoff);
98 if (m_isAbovePriorityCutoff) 98 if (m_isAbovePriorityCutoff)
99 acquireBackingTexture(resourceProvider); 99 acquireBackingTexture(resourceProvider);
100 DCHECK(m_backing); 100 DCHECK(m_backing);
101 resourceProvider->upload(resourceId(), image, imageRect, sourceRect, destOff set); 101 resourceProvider->setPixels(resourceId(), image, imageRect, sourceRect, dest Offset);
102 102
103 // The component order may be bgra if we uploaded bgra pixels to rgba 103 // The component order may be bgra if we uploaded bgra pixels to rgba
104 // texture. Mark contents as swizzled if image component order is 104 // texture. Mark contents as swizzled if image component order is
105 // different than texture format. 105 // different than texture format.
106 m_contentsSwizzled = !PlatformColor::sameComponentOrder(m_format); 106 m_contentsSwizzled = !PlatformColor::sameComponentOrder(m_format);
107 } 107 }
108 108
109 void PrioritizedTexture::link(Backing* backing) 109 void PrioritizedTexture::link(Backing* backing)
110 { 110 {
111 DCHECK(backing); 111 DCHECK(backing);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 } 197 }
198 198
199 void PrioritizedTexture::returnBackingTexture() 199 void PrioritizedTexture::returnBackingTexture()
200 { 200 {
201 DCHECK(m_manager || !m_backing); 201 DCHECK(m_manager || !m_backing);
202 if (m_manager) 202 if (m_manager)
203 m_manager->returnBackingTexture(this); 203 m_manager->returnBackingTexture(this);
204 } 204 }
205 205
206 } // namespace cc 206 } // namespace cc
OLDNEW
« no previous file with comments | « cc/prioritized_texture.h ('k') | cc/resource_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698