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

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

Issue 1143373004: gpu: Extend CopyTextureCHROMIUM with support for copying part of source texture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: keep TODO for now Created 5 years, 7 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 | « no previous file | gpu/GLES2/extensions/CHROMIUM/CHROMIUM_copy_texture.txt » ('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 1968 matching lines...) Expand 10 before | Expand all | Expand 10 after
1979 // implementations. crbug.com/436314 1979 // implementations. crbug.com/436314
1980 gl->BeginQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM, 1980 gl->BeginQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM,
1981 source_resource->gl_read_lock_query_id); 1981 source_resource->gl_read_lock_query_id);
1982 #else 1982 #else
1983 gl->BeginQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM, 1983 gl->BeginQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM,
1984 source_resource->gl_read_lock_query_id); 1984 source_resource->gl_read_lock_query_id);
1985 #endif 1985 #endif
1986 } 1986 }
1987 DCHECK(!dest_resource->image_id); 1987 DCHECK(!dest_resource->image_id);
1988 dest_resource->allocated = true; 1988 dest_resource->allocated = true;
1989 gl->CopySubTextureCHROMIUM(dest_resource->target, source_resource->gl_id, 1989 gl->CopySubTextureCHROMIUM(
1990 dest_resource->gl_id, 0, 0); 1990 dest_resource->target, source_resource->gl_id, dest_resource->gl_id, 0, 0,
1991 0, 0, dest_resource->size.width(), dest_resource->size.height());
1991 if (source_resource->gl_read_lock_query_id) { 1992 if (source_resource->gl_read_lock_query_id) {
1992 // End query and create a read lock fence that will prevent access to 1993 // End query and create a read lock fence that will prevent access to
1993 // source resource until CopySubTextureCHROMIUM command has completed. 1994 // source resource until CopySubTextureCHROMIUM command has completed.
1994 #if defined(OS_CHROMEOS) 1995 #if defined(OS_CHROMEOS)
1995 gl->EndQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM); 1996 gl->EndQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM);
1996 #else 1997 #else
1997 gl->EndQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM); 1998 gl->EndQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM);
1998 #endif 1999 #endif
1999 source_resource->read_lock_fence = make_scoped_refptr( 2000 source_resource->read_lock_fence = make_scoped_refptr(
2000 new CopyTextureFence(gl, source_resource->gl_read_lock_query_id)); 2001 new CopyTextureFence(gl, source_resource->gl_read_lock_query_id));
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
2052 } 2053 }
2053 2054
2054 class GrContext* ResourceProvider::GrContext(bool worker_context) const { 2055 class GrContext* ResourceProvider::GrContext(bool worker_context) const {
2055 ContextProvider* context_provider = 2056 ContextProvider* context_provider =
2056 worker_context ? output_surface_->worker_context_provider() 2057 worker_context ? output_surface_->worker_context_provider()
2057 : output_surface_->context_provider(); 2058 : output_surface_->context_provider();
2058 return context_provider ? context_provider->GrContext() : NULL; 2059 return context_provider ? context_provider->GrContext() : NULL;
2059 } 2060 }
2060 2061
2061 } // namespace cc 2062 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | gpu/GLES2/extensions/CHROMIUM/CHROMIUM_copy_texture.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698