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

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

Issue 972833004: Revert of gpu: introduce glCopySubTextureCHROMIUM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | content/common/gpu/media/android_video_decode_accelerator.cc » ('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 2089 matching lines...) Expand 10 before | Expand all | Expand 10 after
2100 // implementations. crbug.com/436314 2100 // implementations. crbug.com/436314
2101 gl->BeginQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM, 2101 gl->BeginQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM,
2102 source_resource->gl_read_lock_query_id); 2102 source_resource->gl_read_lock_query_id);
2103 #else 2103 #else
2104 gl->BeginQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM, 2104 gl->BeginQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM,
2105 source_resource->gl_read_lock_query_id); 2105 source_resource->gl_read_lock_query_id);
2106 #endif 2106 #endif
2107 } 2107 }
2108 DCHECK(!dest_resource->image_id); 2108 DCHECK(!dest_resource->image_id);
2109 dest_resource->allocated = true; 2109 dest_resource->allocated = true;
2110 gl->CopySubTextureCHROMIUM(dest_resource->target, source_resource->gl_id, 2110 gl->CopyTextureCHROMIUM(dest_resource->target,
2111 dest_resource->gl_id, 0, 0); 2111 source_resource->gl_id,
2112 dest_resource->gl_id,
2113 0,
2114 GLInternalFormat(dest_resource->format),
2115 GLDataType(dest_resource->format));
2112 if (source_resource->gl_read_lock_query_id) { 2116 if (source_resource->gl_read_lock_query_id) {
2113 // End query and create a read lock fence that will prevent access to 2117 // End query and create a read lock fence that will prevent access to
2114 // source resource until CopySubTextureCHROMIUM command has completed. 2118 // source resource until CopyTextureCHROMIUM command has completed.
2115 #if defined(OS_CHROMEOS) 2119 #if defined(OS_CHROMEOS)
2116 gl->EndQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM); 2120 gl->EndQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM);
2117 #else 2121 #else
2118 gl->EndQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM); 2122 gl->EndQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM);
2119 #endif 2123 #endif
2120 source_resource->read_lock_fence = make_scoped_refptr( 2124 source_resource->read_lock_fence = make_scoped_refptr(
2121 new CopyTextureFence(gl, source_resource->gl_read_lock_query_id)); 2125 new CopyTextureFence(gl, source_resource->gl_read_lock_query_id));
2122 } else { 2126 } else {
2123 // Create a SynchronousFence when CHROMIUM_sync_query extension is missing. 2127 // Create a SynchronousFence when CHROMIUM_sync_query extension is missing.
2124 // Try to use one synchronous fence for as many CopyResource operations as 2128 // Try to use one synchronous fence for as many CopyResource operations as
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
2167 } 2171 }
2168 2172
2169 class GrContext* ResourceProvider::GrContext(bool worker_context) const { 2173 class GrContext* ResourceProvider::GrContext(bool worker_context) const {
2170 ContextProvider* context_provider = 2174 ContextProvider* context_provider =
2171 worker_context ? output_surface_->worker_context_provider() 2175 worker_context ? output_surface_->worker_context_provider()
2172 : output_surface_->context_provider(); 2176 : output_surface_->context_provider();
2173 return context_provider ? context_provider->GrContext() : NULL; 2177 return context_provider ? context_provider->GrContext() : NULL;
2174 } 2178 }
2175 2179
2176 } // namespace cc 2180 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/media/android_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698