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

Side by Side Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 19267016: Add a flag to allow renderer to use software compositor when GL compositor doesn't work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "content/browser/renderer_host/compositor_impl_android.h" 5 #include "content/browser/renderer_host/compositor_impl_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 #include <android/native_window_jni.h> 8 #include <android/native_window_jni.h>
9 #include <map> 9 #include <map>
10 10
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 DCHECK(bitmap.size() == sub_rect.size()); 352 DCHECK(bitmap.size() == sub_rect.size());
353 if (bitmap.size() != sub_rect.size() || texture_id == 0) return false; 353 if (bitmap.size() != sub_rect.size() || texture_id == 0) return false;
354 354
355 GLHelper* helper = ImageTransportFactoryAndroid::GetInstance()->GetGLHelper(); 355 GLHelper* helper = ImageTransportFactoryAndroid::GetInstance()->GetGLHelper();
356 helper->ReadbackTextureSync(texture_id, 356 helper->ReadbackTextureSync(texture_id,
357 sub_rect, 357 sub_rect,
358 static_cast<unsigned char*> (bitmap.pixels())); 358 static_cast<unsigned char*> (bitmap.pixels()));
359 return true; 359 return true;
360 } 360 }
361 361
362 scoped_ptr<cc::OutputSurface> CompositorImpl::CreateOutputSurface() { 362 scoped_ptr<cc::OutputSurface> CompositorImpl::CreateOutputSurface(
363 bool fallback) {
363 WebKit::WebGraphicsContext3D::Attributes attrs; 364 WebKit::WebGraphicsContext3D::Attributes attrs;
364 attrs.shareResources = true; 365 attrs.shareResources = true;
365 attrs.noAutomaticFlushes = true; 366 attrs.noAutomaticFlushes = true;
366 367
367 if (g_use_direct_gl) { 368 if (g_use_direct_gl) {
368 scoped_ptr<WebKit::WebGraphicsContext3D> context( 369 scoped_ptr<WebKit::WebGraphicsContext3D> context(
369 webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl:: 370 webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl::
370 CreateViewContext(attrs, window_)); 371 CreateViewContext(attrs, window_));
371 if (!window_) { 372 if (!window_) {
372 return scoped_ptr<cc::OutputSurface>( 373 return scoped_ptr<cc::OutputSurface>(
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 case ANDROID_BITMAP_FORMAT_RGBA_8888: 498 case ANDROID_BITMAP_FORMAT_RGBA_8888:
498 return GL_UNSIGNED_BYTE; 499 return GL_UNSIGNED_BYTE;
499 break; 500 break;
500 case ANDROID_BITMAP_FORMAT_RGB_565: 501 case ANDROID_BITMAP_FORMAT_RGB_565:
501 default: 502 default:
502 return GL_UNSIGNED_SHORT_5_6_5; 503 return GL_UNSIGNED_SHORT_5_6_5;
503 } 504 }
504 } 505 }
505 506
506 } // namespace content 507 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698