| 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/gpu/gpu_backing_store_glx.h" | 5 #include "chrome/gpu/gpu_backing_store_glx.h" |
| 6 | 6 |
| 7 #include "app/gfx/gl/gl_bindings.h" | 7 #include "app/gfx/gl/gl_bindings.h" |
| 8 #include "app/surface/transport_dib.h" | 8 #include "app/surface/transport_dib.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "chrome/common/gpu_messages.h" | 10 #include "chrome/common/gpu_messages.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // FIXME(brettw) does this mean we aren't getting any more messages and we | 56 // FIXME(brettw) does this mean we aren't getting any more messages and we |
| 57 // should delete outselves? | 57 // should delete outselves? |
| 58 NOTIMPLEMENTED(); | 58 NOTIMPLEMENTED(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void GpuBackingStoreGLX::OnPaintToBackingStore( | 61 void GpuBackingStoreGLX::OnPaintToBackingStore( |
| 62 base::ProcessId source_process_id, | 62 base::ProcessId source_process_id, |
| 63 TransportDIB::Id id, | 63 TransportDIB::Id id, |
| 64 const gfx::Rect& bitmap_rect, | 64 const gfx::Rect& bitmap_rect, |
| 65 const std::vector<gfx::Rect>& copy_rects) { | 65 const std::vector<gfx::Rect>& copy_rects) { |
| 66 TransportDIB* dib = TransportDIB::Map(id); | 66 scoped_ptr<TransportDIB> dib(TransportDIB::Map(id)); |
| 67 view_->BindContext(); | 67 view_->BindContext(); |
| 68 | 68 |
| 69 scoped_ptr<skia::PlatformCanvas> canvas( | 69 scoped_ptr<skia::PlatformCanvas> canvas( |
| 70 dib->GetPlatformCanvas(bitmap_rect.width(), bitmap_rect.height())); | 70 dib->GetPlatformCanvas(bitmap_rect.width(), bitmap_rect.height())); |
| 71 const SkBitmap& transport_bitmap = | 71 const SkBitmap& transport_bitmap = |
| 72 canvas->getTopPlatformDevice().accessBitmap(false); | 72 canvas->getTopPlatformDevice().accessBitmap(false); |
| 73 | 73 |
| 74 for (size_t i = 0; i < copy_rects.size(); i++) | 74 for (size_t i = 0; i < copy_rects.size(); i++) |
| 75 PaintOneRectToBackingStore(transport_bitmap, bitmap_rect, copy_rects[i]); | 75 PaintOneRectToBackingStore(transport_bitmap, bitmap_rect, copy_rects[i]); |
| 76 | 76 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 DCHECK(err == GL_NO_ERROR) << "Error " << err << | 220 DCHECK(err == GL_NO_ERROR) << "Error " << err << |
| 221 " copying (" << copy_rect.x() << "," << copy_rect.y() << | 221 " copying (" << copy_rect.x() << "," << copy_rect.y() << |
| 222 ")," << copy_rect.width() << "x" << copy_rect.height() << | 222 ")," << copy_rect.width() << "x" << copy_rect.height() << |
| 223 " for bitmap " << texture_size_.width() << "x" << | 223 " for bitmap " << texture_size_.width() << "x" << |
| 224 texture_size_.height() << | 224 texture_size_.height() << |
| 225 " real size " << existing_width << "x" << existing_height << | 225 " real size " << existing_width << "x" << existing_height << |
| 226 " for " << this; | 226 " for " << this; |
| 227 */ | 227 */ |
| 228 } | 228 } |
| 229 } | 229 } |
| OLD | NEW |