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

Side by Side Diff: cc/resources/prioritized_resource.cc

Issue 132163009: [#6]Pass gfx structs by const ref (gfx::Vector2d) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on TOT 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/prioritized_resource.h ('k') | cc/resources/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 "cc/resources/prioritized_resource.h" 5 #include "cc/resources/prioritized_resource.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "cc/resources/platform_color.h" 9 #include "cc/resources/platform_color.h"
10 #include "cc/resources/prioritized_resource_manager.h" 10 #include "cc/resources/prioritized_resource_manager.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 ResourceProvider* resource_provider) { 72 ResourceProvider* resource_provider) {
73 DCHECK(is_above_priority_cutoff_); 73 DCHECK(is_above_priority_cutoff_);
74 if (is_above_priority_cutoff_) 74 if (is_above_priority_cutoff_)
75 manager_->AcquireBackingTextureIfNeeded(this, resource_provider); 75 manager_->AcquireBackingTextureIfNeeded(this, resource_provider);
76 } 76 }
77 77
78 void PrioritizedResource::SetPixels(ResourceProvider* resource_provider, 78 void PrioritizedResource::SetPixels(ResourceProvider* resource_provider,
79 const uint8_t* image, 79 const uint8_t* image,
80 const gfx::Rect& image_rect, 80 const gfx::Rect& image_rect,
81 const gfx::Rect& source_rect, 81 const gfx::Rect& source_rect,
82 gfx::Vector2d dest_offset) { 82 const gfx::Vector2d& dest_offset) {
83 DCHECK(is_above_priority_cutoff_); 83 DCHECK(is_above_priority_cutoff_);
84 if (is_above_priority_cutoff_) 84 if (is_above_priority_cutoff_)
85 AcquireBackingTexture(resource_provider); 85 AcquireBackingTexture(resource_provider);
86 DCHECK(backing_); 86 DCHECK(backing_);
87 resource_provider->SetPixels( 87 resource_provider->SetPixels(
88 resource_id(), image, image_rect, source_rect, dest_offset); 88 resource_id(), image, image_rect, source_rect, dest_offset);
89 89
90 // The component order may be bgra if we uploaded bgra pixels to rgba 90 // The component order may be bgra if we uploaded bgra pixels to rgba
91 // texture. Mark contents as swizzled if image component order is 91 // texture. Mark contents as swizzled if image component order is
92 // different than texture format. 92 // different than texture format.
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 manager_->ReturnBackingTexture(this); 193 manager_->ReturnBackingTexture(this);
194 } 194 }
195 195
196 const Proxy* PrioritizedResource::Backing::proxy() const { 196 const Proxy* PrioritizedResource::Backing::proxy() const {
197 if (!owner_ || !owner_->resource_manager()) 197 if (!owner_ || !owner_->resource_manager())
198 return NULL; 198 return NULL;
199 return owner_->resource_manager()->ProxyForDebug(); 199 return owner_->resource_manager()->ProxyForDebug();
200 } 200 }
201 201
202 } // namespace cc 202 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/prioritized_resource.h ('k') | cc/resources/resource_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698