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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/TextureHolder.h

Issue 2455983005: Refactor AcceleratedStaticBitmapImage (Closed)
Patch Set: fix crash Created 4 years, 1 month 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef TextureHolder_h
6 #define TextureHolder_h
7
8 #include "gpu/command_buffer/common/mailbox.h"
9 #include "gpu/command_buffer/common/sync_token.h"
10 #include "platform/PlatformExport.h"
11 #include "platform/geometry/IntSize.h"
12 #include "platform/graphics/Image.h"
13 #include "public/platform/WebTaskRunner.h"
14 #include "third_party/skia/include/core/SkImage.h"
15 #include "third_party/skia/include/core/SkRefCnt.h"
16
17 namespace blink {
18
19 class PLATFORM_EXPORT TextureHolder {
20 public:
21 virtual ~TextureHolder() {}
22
23 // Methods overrided by all sub-classes
24 virtual bool isSkiaTextureHolder() = 0;
25 virtual bool isMailboxTextureHolder() = 0;
26 virtual unsigned sharedContextId() = 0;
27 virtual IntSize size() const = 0;
28 virtual bool currentFrameKnownToBeOpaque(Image::MetadataMode) = 0;
29 virtual WebTaskRunner* imageThreadTaskRunner() = 0;
30
31 // Methods overrided by MailboxTextureHolder
32 virtual gpu::Mailbox mailbox() {
33 NOTREACHED();
34 return gpu::Mailbox();
35 }
36 virtual gpu::SyncToken syncToken() {
37 NOTREACHED();
38 return gpu::SyncToken();
39 }
40 virtual void updateSyncToken(gpu::SyncToken) { NOTREACHED(); }
41
42 // Methods overrided by SkiaTextureHolder
43 virtual sk_sp<SkImage> skImage() {
44 NOTREACHED();
45 return nullptr;
46 }
47 virtual void setSharedContextId(unsigned) { NOTREACHED(); }
48 virtual void setImageThreadTaskRunner(std::unique_ptr<WebTaskRunner>) {
49 NOTREACHED();
50 }
51 };
52
53 } // namespace blink
54
55 #endif // TextureHolder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698