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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp

Issue 2610853005: Modify Copy{Sub}TextureCHROMIUM entry point to add level argument (Closed)
Patch Set: fix chromeos 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 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 #include "platform/graphics/AcceleratedStaticBitmapImage.h" 5 #include "platform/graphics/AcceleratedStaticBitmapImage.h"
6 6
7 #include "gpu/command_buffer/client/gles2_interface.h" 7 #include "gpu/command_buffer/client/gles2_interface.h"
8 #include "gpu/command_buffer/common/sync_token.h" 8 #include "gpu/command_buffer/common/sync_token.h"
9 #include "platform/graphics/MailboxTextureHolder.h" 9 #include "platform/graphics/MailboxTextureHolder.h"
10 #include "platform/graphics/SkiaTextureHolder.h" 10 #include "platform/graphics/SkiaTextureHolder.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 return; 75 return;
76 // |destProvider| may not be the same context as the one used for |m_image|, 76 // |destProvider| may not be the same context as the one used for |m_image|,
77 // so we use a mailbox to generate a texture id for |destProvider| to access. 77 // so we use a mailbox to generate a texture id for |destProvider| to access.
78 ensureMailbox(); 78 ensureMailbox();
79 79
80 // Get a texture id that |destProvider| knows about and copy from it. 80 // Get a texture id that |destProvider| knows about and copy from it.
81 gpu::gles2::GLES2Interface* destGL = destProvider->contextGL(); 81 gpu::gles2::GLES2Interface* destGL = destProvider->contextGL();
82 destGL->WaitSyncTokenCHROMIUM(m_textureHolder->syncToken().GetData()); 82 destGL->WaitSyncTokenCHROMIUM(m_textureHolder->syncToken().GetData());
83 GLuint sourceTextureId = destGL->CreateAndConsumeTextureCHROMIUM( 83 GLuint sourceTextureId = destGL->CreateAndConsumeTextureCHROMIUM(
84 GL_TEXTURE_2D, m_textureHolder->mailbox().name); 84 GL_TEXTURE_2D, m_textureHolder->mailbox().name);
85 destGL->CopyTextureCHROMIUM(sourceTextureId, destTextureId, internalFormat, 85 destGL->CopyTextureCHROMIUM(sourceTextureId, 0, destTextureId, 0,
86 destType, flipY, false, false); 86 internalFormat, destType, flipY, false, false);
87 // This drops the |destGL| context's reference on our |m_mailbox|, but it's 87 // This drops the |destGL| context's reference on our |m_mailbox|, but it's
88 // still held alive by our SkImage. 88 // still held alive by our SkImage.
89 destGL->DeleteTextures(1, &sourceTextureId); 89 destGL->DeleteTextures(1, &sourceTextureId);
90 } 90 }
91 91
92 sk_sp<SkImage> AcceleratedStaticBitmapImage::imageForCurrentFrame( 92 sk_sp<SkImage> AcceleratedStaticBitmapImage::imageForCurrentFrame(
93 const ColorBehavior& colorBehavior) { 93 const ColorBehavior& colorBehavior) {
94 // TODO(ccameron): This function should not ignore |colorBehavior|. 94 // TODO(ccameron): This function should not ignore |colorBehavior|.
95 // https://crbug.com/672306 95 // https://crbug.com/672306
96 checkThread(); 96 checkThread();
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 void AcceleratedStaticBitmapImage::checkThread() { 174 void AcceleratedStaticBitmapImage::checkThread() {
175 if (m_detachThreadAtNextCheck) { 175 if (m_detachThreadAtNextCheck) {
176 m_threadChecker.DetachFromThread(); 176 m_threadChecker.DetachFromThread();
177 m_detachThreadAtNextCheck = false; 177 m_detachThreadAtNextCheck = false;
178 } 178 }
179 CHECK(m_threadChecker.CalledOnValidThread()); 179 CHECK(m_threadChecker.CalledOnValidThread());
180 } 180 }
181 181
182 } // namespace blink 182 } // namespace blink
OLDNEW
« no previous file with comments | « media/renderers/skcanvas_video_renderer.cc ('k') | third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698