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

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

Issue 12038095: Android webview fix gpu crashes after destroy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More fixes Created 7 years, 10 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 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 : root_layer_(cc::Layer::create()), 125 : root_layer_(cc::Layer::create()),
126 has_transparent_background_(false), 126 has_transparent_background_(false),
127 window_(NULL), 127 window_(NULL),
128 surface_id_(0), 128 surface_id_(0),
129 client_(client), 129 client_(client),
130 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { 130 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
131 DCHECK(client); 131 DCHECK(client);
132 } 132 }
133 133
134 CompositorImpl::~CompositorImpl() { 134 CompositorImpl::~CompositorImpl() {
135 SetWindowSurface(NULL);
boliu 2013/01/26 01:18:00 This was my attempt at fixing the crash inside and
no sievers 2013/01/28 19:46:15 Yes, this SetWindowSurface() codepath here is not
135 } 136 }
136 137
137 void CompositorImpl::Composite() { 138 void CompositorImpl::Composite() {
138 if (host_.get()) 139 if (host_.get())
139 host_->composite(); 140 host_->composite();
140 } 141 }
141 142
142 void CompositorImpl::SetRootLayer(scoped_refptr<cc::Layer> root_layer) { 143 void CompositorImpl::SetRootLayer(scoped_refptr<cc::Layer> root_layer) {
143 root_layer_->removeAllChildren(); 144 root_layer_->removeAllChildren();
144 root_layer_->addChild(root_layer); 145 root_layer_->addChild(root_layer);
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 case ANDROID_BITMAP_FORMAT_RGBA_8888: 425 case ANDROID_BITMAP_FORMAT_RGBA_8888:
425 return GL_UNSIGNED_BYTE; 426 return GL_UNSIGNED_BYTE;
426 break; 427 break;
427 case ANDROID_BITMAP_FORMAT_RGB_565: 428 case ANDROID_BITMAP_FORMAT_RGB_565:
428 default: 429 default:
429 return GL_UNSIGNED_SHORT_5_6_5; 430 return GL_UNSIGNED_SHORT_5_6_5;
430 } 431 }
431 } 432 }
432 433
433 } // namespace content 434 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | content/common/gpu/gpu_command_buffer_stub.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698