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

Side by Side Diff: cc/resources/resource_provider.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/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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 593
594 ResourceProvider::ResourceType ResourceProvider::GetResourceType( 594 ResourceProvider::ResourceType ResourceProvider::GetResourceType(
595 ResourceId id) { 595 ResourceId id) {
596 return GetResource(id)->type; 596 return GetResource(id)->type;
597 } 597 }
598 598
599 void ResourceProvider::SetPixels(ResourceId id, 599 void ResourceProvider::SetPixels(ResourceId id,
600 const uint8_t* image, 600 const uint8_t* image,
601 const gfx::Rect& image_rect, 601 const gfx::Rect& image_rect,
602 const gfx::Rect& source_rect, 602 const gfx::Rect& source_rect,
603 gfx::Vector2d dest_offset) { 603 const gfx::Vector2d& dest_offset) {
604 Resource* resource = GetResource(id); 604 Resource* resource = GetResource(id);
605 DCHECK(!resource->locked_for_write); 605 DCHECK(!resource->locked_for_write);
606 DCHECK(!resource->lock_for_read_count); 606 DCHECK(!resource->lock_for_read_count);
607 DCHECK(resource->origin == Resource::Internal); 607 DCHECK(resource->origin == Resource::Internal);
608 DCHECK_EQ(resource->exported_count, 0); 608 DCHECK_EQ(resource->exported_count, 0);
609 DCHECK(ReadLockFenceHasPassed(resource)); 609 DCHECK(ReadLockFenceHasPassed(resource));
610 LazyAllocate(resource); 610 LazyAllocate(resource);
611 611
612 if (resource->gl_id) { 612 if (resource->gl_id) {
613 DCHECK(!resource->pending_set_pixels); 613 DCHECK(!resource->pending_set_pixels);
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1851 gl->GetIntegerv(GL_ACTIVE_TEXTURE, &active_unit); 1851 gl->GetIntegerv(GL_ACTIVE_TEXTURE, &active_unit);
1852 return active_unit; 1852 return active_unit;
1853 } 1853 }
1854 1854
1855 GLES2Interface* ResourceProvider::ContextGL() const { 1855 GLES2Interface* ResourceProvider::ContextGL() const {
1856 ContextProvider* context_provider = output_surface_->context_provider(); 1856 ContextProvider* context_provider = output_surface_->context_provider();
1857 return context_provider ? context_provider->ContextGL() : NULL; 1857 return context_provider ? context_provider->ContextGL() : NULL;
1858 } 1858 }
1859 1859
1860 } // namespace cc 1860 } // 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