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

Side by Side Diff: cc/resources/resource_provider.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/resource_provider.h ('k') | cc/resources/resource_update.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/resource_provider.h" 5 #include "cc/resources/resource_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 resources_.erase(it); 577 resources_.erase(it);
578 } 578 }
579 579
580 ResourceProvider::ResourceType ResourceProvider::GetResourceType( 580 ResourceProvider::ResourceType ResourceProvider::GetResourceType(
581 ResourceId id) { 581 ResourceId id) {
582 return GetResource(id)->type; 582 return GetResource(id)->type;
583 } 583 }
584 584
585 void ResourceProvider::SetPixels(ResourceId id, 585 void ResourceProvider::SetPixels(ResourceId id,
586 const uint8_t* image, 586 const uint8_t* image,
587 gfx::Rect image_rect, 587 const gfx::Rect& image_rect,
588 gfx::Rect source_rect, 588 const gfx::Rect& source_rect,
589 gfx::Vector2d dest_offset) { 589 gfx::Vector2d dest_offset) {
590 Resource* resource = GetResource(id); 590 Resource* resource = GetResource(id);
591 DCHECK(!resource->locked_for_write); 591 DCHECK(!resource->locked_for_write);
592 DCHECK(!resource->lock_for_read_count); 592 DCHECK(!resource->lock_for_read_count);
593 DCHECK(!resource->external); 593 DCHECK(!resource->external);
594 DCHECK_EQ(resource->exported_count, 0); 594 DCHECK_EQ(resource->exported_count, 0);
595 DCHECK(ReadLockFenceHasPassed(resource)); 595 DCHECK(ReadLockFenceHasPassed(resource));
596 LazyAllocate(resource); 596 LazyAllocate(resource);
597 597
598 if (resource->gl_id) { 598 if (resource->gl_id) {
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1804 gl->GetIntegerv(GL_ACTIVE_TEXTURE, &active_unit); 1804 gl->GetIntegerv(GL_ACTIVE_TEXTURE, &active_unit);
1805 return active_unit; 1805 return active_unit;
1806 } 1806 }
1807 1807
1808 GLES2Interface* ResourceProvider::ContextGL() const { 1808 GLES2Interface* ResourceProvider::ContextGL() const {
1809 ContextProvider* context_provider = output_surface_->context_provider(); 1809 ContextProvider* context_provider = output_surface_->context_provider();
1810 return context_provider ? context_provider->ContextGL() : NULL; 1810 return context_provider ? context_provider->ContextGL() : NULL;
1811 } 1811 }
1812 1812
1813 } // namespace cc 1813 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/resource_provider.h ('k') | cc/resources/resource_update.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698