OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/renderer_host/backing_store.h" |
| 6 |
| 7 BackingStore::BackingStore(const gfx::Size& size) |
| 8 : size_(size) { |
| 9 if (!canvas_.initialize(size.width(), size.height(), true)) |
| 10 SK_CRASH(); |
| 11 } |
| 12 |
| 13 BackingStore::~BackingStore() { |
| 14 } |
| 15 |
| 16 bool BackingStore::PaintRect(base::ProcessHandle process, |
| 17 BitmapWireData bitmap, |
| 18 const gfx::Rect& bitmap_rect) { |
| 19 if (bitmap.width() != bitmap_rect.width() || |
| 20 bitmap.height() != bitmap_rect.height() || |
| 21 bitmap.config() != SkBitmap::kARGB_8888_Config) { |
| 22 return false; |
| 23 } |
| 24 |
| 25 canvas_.drawBitmap(bitmap, bitmap_rect.x(), bitmap_rect.y()); |
| 26 return true; |
| 27 } |
| 28 |
| 29 void BackingStore::ScrollRect(base::ProcessHandle process, |
| 30 BitmapWireData bitmap, |
| 31 const gfx::Rect& bitmap_rect, |
| 32 int dx, int dy, |
| 33 const gfx::Rect& clip_rect, |
| 34 const gfx::Size& view_size) { |
| 35 // TODO(port): implement scrolling |
| 36 NOTIMPLEMENTED(); |
| 37 } |
OLD | NEW |