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

Side by Side Diff: cc/tiles/gpu_image_decode_controller.h

Issue 1854723002: cc: Simplify task and its derived classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected scope of dependencies. Created 4 years, 8 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 CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_ 5 #ifndef CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_
6 #define CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_ 6 #define CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_
7 7
8 #include <unordered_map> 8 #include <unordered_map>
9 #include <unordered_set> 9 #include <unordered_set>
10 10
11 #include "base/synchronization/lock.h" 11 #include "base/synchronization/lock.h"
12 #include "cc/base/cc_export.h" 12 #include "cc/base/cc_export.h"
13 #include "cc/tiles/image_decode_controller.h" 13 #include "cc/tiles/image_decode_controller.h"
14 14
15 namespace cc { 15 namespace cc {
16 16
17 class CC_EXPORT GpuImageDecodeController : public ImageDecodeController { 17 class CC_EXPORT GpuImageDecodeController : public ImageDecodeController {
18 public: 18 public:
19 GpuImageDecodeController(); 19 GpuImageDecodeController();
20 ~GpuImageDecodeController() override; 20 ~GpuImageDecodeController() override;
21 21
22 // ImageDecodeController overrides. 22 // ImageDecodeController overrides.
23 bool GetTaskForImageAndRef(const DrawImage& image, 23 bool GetTaskForImageAndRef(const DrawImage& image,
24 uint64_t prepare_tiles_id, 24 uint64_t prepare_tiles_id,
25 scoped_refptr<ImageDecodeTask>* task) override; 25 scoped_refptr<Task>* task) override;
26 void UnrefImage(const DrawImage& image) override; 26 void UnrefImage(const DrawImage& image) override;
27 DecodedDrawImage GetDecodedImageForDraw(const DrawImage& draw_image) override; 27 DecodedDrawImage GetDecodedImageForDraw(const DrawImage& draw_image) override;
28 void DrawWithImageFinished(const DrawImage& image, 28 void DrawWithImageFinished(const DrawImage& image,
29 const DecodedDrawImage& decoded_image) override; 29 const DecodedDrawImage& decoded_image) override;
30 void ReduceCacheUsage() override; 30 void ReduceCacheUsage() override;
31 31
32 void DecodeImage(const DrawImage& image); 32 void DecodeImage(const DrawImage& image);
33 33
34 void RemovePendingTaskForImage(const DrawImage& image); 34 void RemovePendingTaskForImage(const DrawImage& image);
35 35
36 private: 36 private:
37 base::Lock lock_; 37 base::Lock lock_;
38 38
39 std::unordered_set<uint32_t> prerolled_images_; 39 std::unordered_set<uint32_t> prerolled_images_;
40 std::unordered_map<uint32_t, scoped_refptr<ImageDecodeTask>> 40 std::unordered_map<uint32_t, scoped_refptr<Task>> pending_image_tasks_;
41 pending_image_tasks_;
42 }; 41 };
43 42
44 } // namespace cc 43 } // namespace cc
45 44
46 #endif // CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_ 45 #endif // CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698