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

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

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 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/priority_calculator.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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 void PrioritizedResource::AcquireBackingTexture( 70 void PrioritizedResource::AcquireBackingTexture(
71 ResourceProvider* resource_provider) { 71 ResourceProvider* resource_provider) {
72 DCHECK(is_above_priority_cutoff_); 72 DCHECK(is_above_priority_cutoff_);
73 if (is_above_priority_cutoff_) 73 if (is_above_priority_cutoff_)
74 manager_->AcquireBackingTextureIfNeeded(this, resource_provider); 74 manager_->AcquireBackingTextureIfNeeded(this, resource_provider);
75 } 75 }
76 76
77 void PrioritizedResource::SetPixels(ResourceProvider* resource_provider, 77 void PrioritizedResource::SetPixels(ResourceProvider* resource_provider,
78 const uint8_t* image, 78 const uint8_t* image,
79 gfx::Rect image_rect, 79 const gfx::Rect& image_rect,
80 gfx::Rect source_rect, 80 const gfx::Rect& source_rect,
81 gfx::Vector2d dest_offset) { 81 gfx::Vector2d dest_offset) {
82 DCHECK(is_above_priority_cutoff_); 82 DCHECK(is_above_priority_cutoff_);
83 if (is_above_priority_cutoff_) 83 if (is_above_priority_cutoff_)
84 AcquireBackingTexture(resource_provider); 84 AcquireBackingTexture(resource_provider);
85 DCHECK(backing_); 85 DCHECK(backing_);
86 resource_provider->SetPixels( 86 resource_provider->SetPixels(
87 resource_id(), image, image_rect, source_rect, dest_offset); 87 resource_id(), image, image_rect, source_rect, dest_offset);
88 88
89 // The component order may be bgra if we uploaded bgra pixels to rgba 89 // The component order may be bgra if we uploaded bgra pixels to rgba
90 // texture. Mark contents as swizzled if image component order is 90 // texture. Mark contents as swizzled if image component order is
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 manager_->ReturnBackingTexture(this); 192 manager_->ReturnBackingTexture(this);
193 } 193 }
194 194
195 const Proxy* PrioritizedResource::Backing::proxy() const { 195 const Proxy* PrioritizedResource::Backing::proxy() const {
196 if (!owner_ || !owner_->resource_manager()) 196 if (!owner_ || !owner_->resource_manager())
197 return NULL; 197 return NULL;
198 return owner_->resource_manager()->ProxyForDebug(); 198 return owner_->resource_manager()->ProxyForDebug();
199 } 199 }
200 200
201 } // namespace cc 201 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/prioritized_resource.h ('k') | cc/resources/priority_calculator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698