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 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 void CompositorImpl::SetWindowBounds(const gfx::Size& size) { | 247 void CompositorImpl::SetWindowBounds(const gfx::Size& size) { |
248 if (size_ == size) | 248 if (size_ == size) |
249 return; | 249 return; |
250 | 250 |
251 size_ = size; | 251 size_ = size; |
252 if (host_) | 252 if (host_) |
253 host_->SetViewportSize(size); | 253 host_->SetViewportSize(size); |
254 root_layer_->SetBounds(size); | 254 root_layer_->SetBounds(size); |
255 } | 255 } |
256 | 256 |
| 257 void CompositorImpl::SetHasTransparentBackground(bool flag) { |
| 258 has_transparent_background_ = flag; |
| 259 if (host_) |
| 260 host_->set_has_transparent_background(flag); |
| 261 } |
| 262 |
257 bool CompositorImpl::CompositeAndReadback(void *pixels, const gfx::Rect& rect) { | 263 bool CompositorImpl::CompositeAndReadback(void *pixels, const gfx::Rect& rect) { |
258 if (host_) | 264 if (host_) |
259 return host_->CompositeAndReadback(pixels, rect); | 265 return host_->CompositeAndReadback(pixels, rect); |
260 else | 266 else |
261 return false; | 267 return false; |
262 } | 268 } |
263 | 269 |
264 cc::UIResourceId CompositorImpl::GenerateUIResource( | 270 cc::UIResourceId CompositorImpl::GenerateUIResource( |
265 const cc::UIResourceBitmap& bitmap) { | 271 const cc::UIResourceBitmap& bitmap) { |
266 if (!host_) | 272 if (!host_) |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 default: | 494 default: |
489 return GL_UNSIGNED_SHORT_5_6_5; | 495 return GL_UNSIGNED_SHORT_5_6_5; |
490 } | 496 } |
491 } | 497 } |
492 | 498 |
493 void CompositorImpl::DidCommit() { | 499 void CompositorImpl::DidCommit() { |
494 root_window_->OnCompositingDidCommit(); | 500 root_window_->OnCompositingDidCommit(); |
495 } | 501 } |
496 | 502 |
497 } // namespace content | 503 } // namespace content |
OLD | NEW |