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

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

Issue 737373004: cc: Make one-copy tile initialization mechanism use immutable textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | ui/gl/gl_image_memory.cc » ('j') | ui/gl/gl_image_memory.cc » ('J')
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 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after
2070 DCHECK_EQ(GLTexture, source_resource->type); 2070 DCHECK_EQ(GLTexture, source_resource->type);
2071 DCHECK(source_resource->allocated); 2071 DCHECK(source_resource->allocated);
2072 LazyCreate(source_resource); 2072 LazyCreate(source_resource);
2073 2073
2074 Resource* dest_resource = GetResource(dest_id); 2074 Resource* dest_resource = GetResource(dest_id);
2075 DCHECK(!dest_resource->locked_for_write); 2075 DCHECK(!dest_resource->locked_for_write);
2076 DCHECK(!dest_resource->lock_for_read_count); 2076 DCHECK(!dest_resource->lock_for_read_count);
2077 DCHECK(dest_resource->origin == Resource::Internal); 2077 DCHECK(dest_resource->origin == Resource::Internal);
2078 DCHECK_EQ(dest_resource->exported_count, 0); 2078 DCHECK_EQ(dest_resource->exported_count, 0);
2079 DCHECK_EQ(GLTexture, dest_resource->type); 2079 DCHECK_EQ(GLTexture, dest_resource->type);
2080 LazyCreate(dest_resource); 2080 LazyAllocate(dest_resource);
dshwang 2014/11/20 16:58:39 It doesn't regress perf because CopyTextureChromiu
2081 2081
2082 DCHECK_EQ(source_resource->type, dest_resource->type); 2082 DCHECK_EQ(source_resource->type, dest_resource->type);
2083 DCHECK_EQ(source_resource->format, dest_resource->format); 2083 DCHECK_EQ(source_resource->format, dest_resource->format);
2084 DCHECK(source_resource->size == dest_resource->size); 2084 DCHECK(source_resource->size == dest_resource->size);
2085 2085
2086 GLES2Interface* gl = ContextGL(); 2086 GLES2Interface* gl = ContextGL();
2087 DCHECK(gl); 2087 DCHECK(gl);
2088 if (source_resource->image_id && source_resource->dirty_image) { 2088 if (source_resource->image_id && source_resource->dirty_image) {
2089 gl->BindTexture(source_resource->target, source_resource->gl_id); 2089 gl->BindTexture(source_resource->target, source_resource->gl_id);
2090 BindImageForSampling(source_resource); 2090 BindImageForSampling(source_resource);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
2155 ContextProvider* context_provider = output_surface_->context_provider(); 2155 ContextProvider* context_provider = output_surface_->context_provider();
2156 return context_provider ? context_provider->ContextGL() : NULL; 2156 return context_provider ? context_provider->ContextGL() : NULL;
2157 } 2157 }
2158 2158
2159 class GrContext* ResourceProvider::GrContext() const { 2159 class GrContext* ResourceProvider::GrContext() const {
2160 ContextProvider* context_provider = output_surface_->context_provider(); 2160 ContextProvider* context_provider = output_surface_->context_provider();
2161 return context_provider ? context_provider->GrContext() : NULL; 2161 return context_provider ? context_provider->GrContext() : NULL;
2162 } 2162 }
2163 2163
2164 } // namespace cc 2164 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | ui/gl/gl_image_memory.cc » ('j') | ui/gl/gl_image_memory.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698