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