mirror of
https://github.com/encounter/engine.git
synced 2026-03-30 11:09:55 -07:00
Delete "services/sky/compositor/picture_serializer"
This commit is contained in:
@@ -10,8 +10,6 @@ source_set("compositor") {
|
||||
"layer_host.h",
|
||||
"layer_host_client.cc",
|
||||
"layer_host_client.h",
|
||||
"picture_serializer.cc",
|
||||
"picture_serializer.h",
|
||||
"rasterizer.cc",
|
||||
"rasterizer.h",
|
||||
"rasterizer_bitmap.cc",
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
// Copyright 2015 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 "services/sky/compositor/picture_serializer.h"
|
||||
|
||||
#include "third_party/skia/include/core/SkData.h"
|
||||
#include "third_party/skia/include/core/SkPixelSerializer.h"
|
||||
#include "third_party/skia/include/core/SkStream.h"
|
||||
#include "ui/gfx/codec/png_codec.h"
|
||||
|
||||
namespace sky {
|
||||
|
||||
class PngPixelSerializer : public SkPixelSerializer {
|
||||
public:
|
||||
bool onUseEncodedData(const void*, size_t) override { return true; }
|
||||
SkData* onEncodePixels(const SkImageInfo& info, const void* pixels,
|
||||
size_t row_bytes) override {
|
||||
std::vector<unsigned char> data;
|
||||
|
||||
SkBitmap bm;
|
||||
if (!bm.installPixels(info, const_cast<void*>(pixels), row_bytes))
|
||||
return nullptr;
|
||||
if (!gfx::PNGCodec::EncodeBGRASkBitmap(bm, false, &data))
|
||||
return nullptr;
|
||||
return SkData::NewWithCopy(&data.front(), data.size());
|
||||
}
|
||||
};
|
||||
|
||||
void SerializePicture(const char* file_name, SkPicture* picture) {
|
||||
SkFILEWStream stream(file_name);
|
||||
PngPixelSerializer serializer;
|
||||
picture->serialize(&stream, &serializer);
|
||||
}
|
||||
|
||||
} // namespace sky
|
||||
@@ -1,16 +0,0 @@
|
||||
// Copyright 2015 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.
|
||||
|
||||
#ifndef SKY_VIEWER_COMPOSITOR_PICTURE_SERIALIZER_H_
|
||||
#define SKY_VIEWER_COMPOSITOR_PICTURE_SERIALIZER_H_
|
||||
|
||||
#include "third_party/skia/include/core/SkPicture.h"
|
||||
|
||||
namespace sky {
|
||||
|
||||
void SerializePicture(const char* file_name, SkPicture*);
|
||||
|
||||
} // namespace sky
|
||||
|
||||
#endif // SKY_VIEWER_COMPOSITOR_PICTURE_SERIALIZER_H_
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#include "services/sky/compositor/layer_host.h"
|
||||
#include "services/sky/compositor/picture_serializer.h"
|
||||
#include "services/sky/compositor/rasterizer.h"
|
||||
#include "sky/engine/wtf/RefPtr.h"
|
||||
#include "third_party/skia/include/core/SkCanvas.h"
|
||||
@@ -29,12 +28,6 @@ void TextureLayer::Display() {
|
||||
TRACE_EVENT0("sky", "Layer::Display");
|
||||
DCHECK(rasterizer_);
|
||||
RefPtr<SkPicture> picture = RecordPicture();
|
||||
|
||||
#if 0
|
||||
SerializePicture(
|
||||
"/data/data/org.chromium.mojo.shell/cache/layer0.skp", picture.get());
|
||||
#endif
|
||||
|
||||
texture_ = rasterizer_->Rasterize(picture.get());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user