| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/accelerated_surface_container_mac.h" | 5 #include "chrome/browser/renderer_host/accelerated_surface_container_mac.h" |
| 6 | 6 |
| 7 #include "app/surface/io_surface_support_mac.h" | 7 #include "app/surface/io_surface_support_mac.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/renderer_host/accelerated_surface_container_manager_mac
.h" | 9 #include "chrome/browser/renderer_host/accelerated_surface_container_manager_mac
.h" |
| 10 #include "webkit/glue/plugins/webplugin.h" | 10 #include "webkit/glue/plugins/webplugin.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 width_ = width; | 60 width_ = width; |
| 61 height_ = height; | 61 height_ = height; |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 void AcceleratedSurfaceContainerMac::MoveTo( | 65 void AcceleratedSurfaceContainerMac::MoveTo( |
| 66 const webkit_glue::WebPluginGeometry& geom) { | 66 const webkit_glue::WebPluginGeometry& geom) { |
| 67 x_ = geom.window_rect.x(); | 67 x_ = geom.window_rect.x(); |
| 68 y_ = geom.window_rect.y(); | 68 y_ = geom.window_rect.y(); |
| 69 // TODO(kbr): may need to pay attention to cutout rects. | 69 // TODO(kbr): may need to pay attention to cutout rects. |
| 70 clipRect_ = geom.clip_rect; | 70 if (geom.visible) |
| 71 clipRect_ = geom.clip_rect; |
| 72 else |
| 73 clipRect_ = gfx::Rect(); |
| 71 } | 74 } |
| 72 | 75 |
| 73 void AcceleratedSurfaceContainerMac::Draw(CGLContextObj context) { | 76 void AcceleratedSurfaceContainerMac::Draw(CGLContextObj context) { |
| 74 IOSurfaceSupport* io_surface_support = IOSurfaceSupport::Initialize(); | 77 IOSurfaceSupport* io_surface_support = IOSurfaceSupport::Initialize(); |
| 75 GLenum target = GL_TEXTURE_RECTANGLE_ARB; | 78 GLenum target = GL_TEXTURE_RECTANGLE_ARB; |
| 76 if (!texture_) { | 79 if (!texture_) { |
| 77 if ((io_surface_support && !surface_) || | 80 if ((io_surface_support && !surface_) || |
| 78 (!io_surface_support && !transport_dib_.get())) | 81 (!io_surface_support && !transport_dib_.get())) |
| 79 return; | 82 return; |
| 80 glGenTextures(1, &texture_); | 83 glGenTextures(1, &texture_); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 } | 190 } |
| 188 } | 191 } |
| 189 | 192 |
| 190 void AcceleratedSurfaceContainerMac::EnqueueTextureForDeletion() { | 193 void AcceleratedSurfaceContainerMac::EnqueueTextureForDeletion() { |
| 191 if (texture_) { | 194 if (texture_) { |
| 192 manager_->EnqueueTextureForDeletion(texture_); | 195 manager_->EnqueueTextureForDeletion(texture_); |
| 193 texture_ = 0; | 196 texture_ = 0; |
| 194 } | 197 } |
| 195 } | 198 } |
| 196 | 199 |
| OLD | NEW |