Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(892)

Unified Diff: chrome/browser/renderer_host/backing_store_posix.cc

Issue 19491: POSIX: bitmap data on the wire (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/renderer_host/backing_store.cc ('k') | chrome/browser/renderer_host/backing_store_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/backing_store_posix.cc
===================================================================
--- chrome/browser/renderer_host/backing_store_posix.cc (revision 0)
+++ chrome/browser/renderer_host/backing_store_posix.cc (revision 0)
@@ -0,0 +1,37 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/renderer_host/backing_store.h"
+
+BackingStore::BackingStore(const gfx::Size& size)
+ : size_(size) {
+ if (!canvas_.initialize(size.width(), size.height(), true))
+ SK_CRASH();
+}
+
+BackingStore::~BackingStore() {
+}
+
+bool BackingStore::PaintRect(base::ProcessHandle process,
+ BitmapWireData bitmap,
+ const gfx::Rect& bitmap_rect) {
+ if (bitmap.width() != bitmap_rect.width() ||
+ bitmap.height() != bitmap_rect.height() ||
+ bitmap.config() != SkBitmap::kARGB_8888_Config) {
+ return false;
+ }
+
+ canvas_.drawBitmap(bitmap, bitmap_rect.x(), bitmap_rect.y());
+ return true;
+}
+
+void BackingStore::ScrollRect(base::ProcessHandle process,
+ BitmapWireData bitmap,
+ const gfx::Rect& bitmap_rect,
+ int dx, int dy,
+ const gfx::Rect& clip_rect,
+ const gfx::Size& view_size) {
+ // TODO(port): implement scrolling
+ NOTIMPLEMENTED();
+}
« no previous file with comments | « chrome/browser/renderer_host/backing_store.cc ('k') | chrome/browser/renderer_host/backing_store_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698