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

Unified Diff: sky/compositor/display_delegate_bitmap.cc

Issue 854303002: Sky should use an SkPicture when drawing (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fixes Created 5 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
Index: sky/compositor/display_delegate_bitmap.cc
diff --git a/sky/compositor/display_delegate_bitmap.cc b/sky/compositor/display_delegate_bitmap.cc
deleted file mode 100644
index c8ba5537846fc3ebd1e2b666a61cb062166ba2a4..0000000000000000000000000000000000000000
--- a/sky/compositor/display_delegate_bitmap.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2014 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 "sky/compositor/display_delegate_bitmap.h"
-
-#include "sky/compositor/layer_client.h"
-#include "third_party/skia/include/core/SkBitmapDevice.h"
-#include "third_party/skia/include/core/SkCanvas.h"
-#include "ui/gfx/codec/png_codec.h"
-#include "ui/gfx/geometry/rect.h"
-
-namespace sky {
-
-DisplayDelegateBitmap::DisplayDelegateBitmap(LayerClient* client)
- : client_(client) {}
-
-DisplayDelegateBitmap::~DisplayDelegateBitmap() {}
-
-DisplayDelegate* DisplayDelegateBitmap::create(LayerClient* client) {
- return new DisplayDelegateBitmap(client);
-}
-
-void DisplayDelegateBitmap::GetPixelsForTesting(std::vector<unsigned char>* pixels) {
- gfx::PNGCodec::EncodeBGRASkBitmap(bitmap_, true, pixels);
-}
-
-void DisplayDelegateBitmap::Paint(mojo::GaneshSurface& surface, const gfx::Rect& size) {
- bitmap_.allocN32Pixels(size.width(), size.height());
- SkBitmapDevice device(bitmap_);
- SkCanvas canvas(&device);
- // Draw red so we can see when we fail to paint.
- canvas.drawColor(SK_ColorRED);
-
- client_->PaintContents(&canvas, size);
- canvas.flush();
-}
-
-} // namespace sky

Powered by Google App Engine
This is Rietveld 408576698