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

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

Issue 110583008: Enable Canvas2D hardware acceleration for Android WebView Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: 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
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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 DCHECK(gl); 538 DCHECK(gl);
539 GLC(gl, gl->DeleteQueriesEXT(1, &resource->gl_upload_query_id)); 539 GLC(gl, gl->DeleteQueriesEXT(1, &resource->gl_upload_query_id));
540 } 540 }
541 if (resource->gl_pixel_buffer_id) { 541 if (resource->gl_pixel_buffer_id) {
542 GLES2Interface* gl = ContextGL(); 542 GLES2Interface* gl = ContextGL();
543 DCHECK(gl); 543 DCHECK(gl);
544 GLC(gl, gl->DeleteBuffers(1, &resource->gl_pixel_buffer_id)); 544 GLC(gl, gl->DeleteBuffers(1, &resource->gl_pixel_buffer_id));
545 } 545 }
546 if (resource->mailbox.IsValid() && resource->external) { 546 if (resource->mailbox.IsValid() && resource->external) {
547 GLuint sync_point = resource->mailbox.sync_point(); 547 GLuint sync_point = resource->mailbox.sync_point();
548 if (resource->mailbox.IsTexture()) { 548 if (resource->mailbox.IsTexture() && ContextGL() != NULL) {
boliu 2014/01/06 18:16:13 I know I did the same thing in my hack patch, but
549 lost_resource |= lost_output_surface_; 549 lost_resource |= lost_output_surface_;
550 GLES2Interface* gl = ContextGL(); 550 GLES2Interface* gl = ContextGL();
551 DCHECK(gl); 551 DCHECK(gl);
552 if (resource->gl_id) 552 if (resource->gl_id)
553 GLC(gl, gl->DeleteTextures(1, &resource->gl_id)); 553 GLC(gl, gl->DeleteTextures(1, &resource->gl_id));
554 if (!lost_resource && resource->gl_id) 554 if (!lost_resource && resource->gl_id)
555 sync_point = gl->InsertSyncPointCHROMIUM(); 555 sync_point = gl->InsertSyncPointCHROMIUM();
556 } else { 556 } else {
557 DCHECK(resource->mailbox.IsSharedMemory()); 557 DCHECK(resource->mailbox.IsSharedMemory());
558 base::SharedMemory* shared_memory = resource->mailbox.shared_memory(); 558 base::SharedMemory* shared_memory = resource->mailbox.shared_memory();
(...skipping 1245 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

Powered by Google App Engine
This is Rietveld 408576698