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

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

Issue 2455983005: Refactor AcceleratedStaticBitmapImage (Closed)
Patch Set: rebase 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/WebTaskRunner.h"
12 #include "platform/geometry/IntSize.h"
13 #include "platform/graphics/Image.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 WebThread;
20
21 class PLATFORM_EXPORT TextureHolder {
22 public:
23 virtual ~TextureHolder() {}
24
25 // Methods overrided by all sub-classes
26 virtual bool isSkiaTextureHolder() = 0;
27 virtual bool isMailboxTextureHolder() = 0;
28 virtual unsigned sharedContextId() = 0;
29 virtual IntSize size() const = 0;
30 virtual bool currentFrameKnownToBeOpaque(Image::MetadataMode) = 0;
31 virtual WebThread* imageThread() = 0;
32
33 // Methods overrided by MailboxTextureHolder
34 virtual gpu::Mailbox mailbox() {
35 NOTREACHED();
36 return gpu::Mailbox();
37 }
38 virtual gpu::SyncToken syncToken() {
39 NOTREACHED();
40 return gpu::SyncToken();
41 }
42 virtual void updateSyncToken(gpu::SyncToken) { NOTREACHED(); }
43 virtual void deleteTexture() { NOTREACHED(); }
44
45 // Methods overrided by SkiaTextureHolder
46 virtual sk_sp<SkImage> skImage() {
47 NOTREACHED();
48 return nullptr;
49 }
50 virtual void setSharedContextId(unsigned) { NOTREACHED(); }
51 virtual void setImageThread(WebThread*) { NOTREACHED(); }
52 virtual void setImageThreadTaskRunner(std::unique_ptr<WebTaskRunner>) {
53 NOTREACHED();
54 }
55 };
56
57 } // namespace blink
58
59 #endif // TextureHolder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698