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

Side by Side Diff: blimp/engine/renderer/engine_image_serialization_processor.h

Issue 1982893002: [blimp] Add SkPicture caching support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments from kmarshall Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef BLIMP_ENGINE_RENDERER_ENGINE_IMAGE_SERIALIZATION_PROCESSOR_H_ 5 #ifndef BLIMP_ENGINE_RENDERER_ENGINE_IMAGE_SERIALIZATION_PROCESSOR_H_
6 #define BLIMP_ENGINE_RENDERER_ENGINE_IMAGE_SERIALIZATION_PROCESSOR_H_ 6 #define BLIMP_ENGINE_RENDERER_ENGINE_IMAGE_SERIALIZATION_PROCESSOR_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "blimp/common/blimp_common_export.h" 11 #include "blimp/common/blimp_common_export.h"
12 #include "blimp/engine/mojo/blob_channel.mojom.h" 12 #include "blimp/engine/mojo/blob_channel.mojom.h"
13 #include "cc/proto/image_serialization_processor.h" 13 #include "cc/proto/image_serialization_processor.h"
14 #include "third_party/skia/include/core/SkPicture.h" 14 #include "cc/proto/picture_cache.h"
15 15
16 class SkPixelSerializer; 16 class SkPixelSerializer;
17 17
18 namespace content { 18 namespace content {
19 class RenderFrame; 19 class RenderFrame;
20 } // class content 20 } // class content
21 21
22 namespace blimp { 22 namespace blimp {
23 namespace engine { 23 namespace engine {
24 24
25 // EngineImageSerializationProcessor provides functionality to serialize and 25 // EngineImageSerializationProcessor provides functionality to serialize
26 // deserialize Skia images. 26 // and temporarily cache Skia images.
27 class BLIMP_COMMON_EXPORT EngineImageSerializationProcessor 27 class BLIMP_COMMON_EXPORT EngineImageSerializationProcessor
28 : public cc::ImageSerializationProcessor { 28 : public cc::ImageSerializationProcessor {
29 public: 29 public:
30 explicit EngineImageSerializationProcessor( 30 explicit EngineImageSerializationProcessor(
31 mojom::BlobChannelPtr blob_channel); 31 mojom::BlobChannelPtr blob_channel);
32 ~EngineImageSerializationProcessor(); 32 ~EngineImageSerializationProcessor();
33 33
34 // cc::ImageSerializationProcessor implementation. 34 // cc::ImageSerializationProcessor implementation.
35 SkPixelSerializer* GetPixelSerializer() override; 35 std::unique_ptr<cc::EnginePictureCache> CreateEnginePictureCache() override;
36 SkPicture::InstallPixelRefProc GetPixelDeserializer() override; 36 std::unique_ptr<cc::ClientPictureCache> CreateClientPictureCache() override;
37 37
38 private: 38 private:
39 // A serializer that be used to pass in to SkPicture::serialize(...) for
40 // serializing the SkPicture to a stream.
39 std::unique_ptr<SkPixelSerializer> pixel_serializer_; 41 std::unique_ptr<SkPixelSerializer> pixel_serializer_;
42
40 mojom::BlobChannelPtr blob_channel_; 43 mojom::BlobChannelPtr blob_channel_;
41 44
42 DISALLOW_COPY_AND_ASSIGN(EngineImageSerializationProcessor); 45 DISALLOW_COPY_AND_ASSIGN(EngineImageSerializationProcessor);
43 }; 46 };
44 47
45 } // namespace engine 48 } // namespace engine
46 } // namespace blimp 49 } // namespace blimp
47 50
48 #endif // BLIMP_ENGINE_RENDERER_ENGINE_IMAGE_SERIALIZATION_PROCESSOR_H_ 51 #endif // BLIMP_ENGINE_RENDERER_ENGINE_IMAGE_SERIALIZATION_PROCESSOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698