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

Unified Diff: blimp/engine/renderer/blimp_engine_picture_cache.cc

Issue 2629743003: Remove all blimp engine code (Closed)
Patch Set: Use consistent comment style in //chrome Created 3 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: blimp/engine/renderer/blimp_engine_picture_cache.cc
diff --git a/blimp/engine/renderer/blimp_engine_picture_cache.cc b/blimp/engine/renderer/blimp_engine_picture_cache.cc
deleted file mode 100644
index f70b3409535f91a2f14142f646552c53c643e59d..0000000000000000000000000000000000000000
--- a/blimp/engine/renderer/blimp_engine_picture_cache.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2016 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 "blimp/engine/renderer/blimp_engine_picture_cache.h"
-
-#include "base/logging.h"
-#include "base/memory/ptr_util.h"
-
-namespace blimp {
-namespace engine {
-
-BlimpEnginePictureCache::BlimpEnginePictureCache(
- SkPixelSerializer* pixel_serializer)
- : pixel_serializer_(pixel_serializer) {}
-
-BlimpEnginePictureCache::~BlimpEnginePictureCache() = default;
-
-void BlimpEnginePictureCache::MarkUsed(const SkPicture* picture) {
- DCHECK(picture);
- reference_tracker_.IncrementRefCount(picture->uniqueID());
-
- // Do not serialize multiple times, even though the item is referred to from
- // multiple places.
- if (pictures_.find(picture->uniqueID()) != pictures_.end()) {
- return;
- }
-
- Put(picture);
-}
-
-std::vector<cc::PictureData>
-BlimpEnginePictureCache::CalculateCacheUpdateAndFlush() {
- std::vector<uint32_t> added;
- std::vector<uint32_t> removed;
- reference_tracker_.CommitRefCounts(&added, &removed);
-
- // Create cache update consisting of new pictures.
- std::vector<cc::PictureData> update;
- for (const uint32_t item : added) {
- auto entry = pictures_.find(item);
- DCHECK(entry != pictures_.end());
- update.push_back(entry->second);
- }
-
- // All new items will be sent to the client, so clear everything.
- pictures_.clear();
- reference_tracker_.ClearRefCounts();
-
- return update;
-}
-
-void BlimpEnginePictureCache::Put(const SkPicture* picture) {
- sk_sp<SkData> data = picture->serialize(pixel_serializer_);
- DCHECK_GE(data->size(), 0u);
-
- // Store the picture data until it is sent to the client.
- pictures_.insert(
- std::make_pair(picture->uniqueID(),
- cc::PictureData(picture->uniqueID(), std::move(data))));
-}
-
-} // namespace engine
-} // namespace blimp
« no previous file with comments | « blimp/engine/renderer/blimp_engine_picture_cache.h ('k') | blimp/engine/renderer/blimp_engine_picture_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698