Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |