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

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

Issue 2752593003: Migrate WTF::Deque::first() to ::front() (Closed)
Patch Set: one more platform specific reference Created 3 years, 9 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 return false; 258 return false;
259 259
260 GLuint imageTexture = 260 GLuint imageTexture =
261 skia::GrBackendObjectToGrGLTextureInfo(image->getTextureHandle(true)) 261 skia::GrBackendObjectToGrGLTextureInfo(image->getTextureHandle(true))
262 ->fID; 262 ->fID;
263 GLenum textureTarget = GC3D_TEXTURE_RECTANGLE_ARB; 263 GLenum textureTarget = GC3D_TEXTURE_RECTANGLE_ARB;
264 gl->CopySubTextureCHROMIUM( 264 gl->CopySubTextureCHROMIUM(
265 imageTexture, 0, textureTarget, imageInfo->m_textureId, 0, 0, 0, 0, 0, 265 imageTexture, 0, textureTarget, imageInfo->m_textureId, 0, 0, 0, 0, 0,
266 m_size.width(), m_size.height(), GL_FALSE, GL_FALSE, GL_FALSE); 266 m_size.width(), m_size.height(), GL_FALSE, GL_FALSE, GL_FALSE);
267 267
268 MailboxInfo& info = m_mailboxes.first(); 268 MailboxInfo& info = m_mailboxes.front();
269 gpu::Mailbox mailbox; 269 gpu::Mailbox mailbox;
270 gl->GenMailboxCHROMIUM(mailbox.name); 270 gl->GenMailboxCHROMIUM(mailbox.name);
271 gl->ProduceTextureDirectCHROMIUM(imageInfo->m_textureId, textureTarget, 271 gl->ProduceTextureDirectCHROMIUM(imageInfo->m_textureId, textureTarget,
272 mailbox.name); 272 mailbox.name);
273 273
274 const GLuint64 fenceSync = gl->InsertFenceSyncCHROMIUM(); 274 const GLuint64 fenceSync = gl->InsertFenceSyncCHROMIUM();
275 gl->Flush(); 275 gl->Flush();
276 gpu::SyncToken syncToken; 276 gpu::SyncToken syncToken;
277 gl->GenSyncTokenCHROMIUM(fenceSync, syncToken.GetData()); 277 gl->GenSyncTokenCHROMIUM(fenceSync, syncToken.GetData());
278 278
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 void Canvas2DLayerBridge::createMailboxInfo() { 369 void Canvas2DLayerBridge::createMailboxInfo() {
370 MailboxInfo tmp; 370 MailboxInfo tmp;
371 tmp.m_parentLayerBridge = this; 371 tmp.m_parentLayerBridge = this;
372 m_mailboxes.prepend(tmp); 372 m_mailboxes.prepend(tmp);
373 } 373 }
374 374
375 bool Canvas2DLayerBridge::prepareMailboxFromImage( 375 bool Canvas2DLayerBridge::prepareMailboxFromImage(
376 sk_sp<SkImage> image, 376 sk_sp<SkImage> image,
377 cc::TextureMailbox* outMailbox) { 377 cc::TextureMailbox* outMailbox) {
378 createMailboxInfo(); 378 createMailboxInfo();
379 MailboxInfo& mailboxInfo = m_mailboxes.first(); 379 MailboxInfo& mailboxInfo = m_mailboxes.front();
380 380
381 GrContext* grContext = m_contextProvider->grContext(); 381 GrContext* grContext = m_contextProvider->grContext();
382 if (!grContext) { 382 if (!grContext) {
383 mailboxInfo.m_image = std::move(image); 383 mailboxInfo.m_image = std::move(image);
384 // For testing, skip GL stuff when using a mock graphics context. 384 // For testing, skip GL stuff when using a mock graphics context.
385 return true; 385 return true;
386 } 386 }
387 387
388 #if USE_IOSURFACE_FOR_2D_CANVAS 388 #if USE_IOSURFACE_FOR_2D_CANVAS
389 if (RuntimeEnabledFeatures::canvas2dImageChromiumEnabled()) { 389 if (RuntimeEnabledFeatures::canvas2dImageChromiumEnabled()) {
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 default; 1116 default;
1117 1117
1118 void Canvas2DLayerBridge::Logger::reportHibernationEvent( 1118 void Canvas2DLayerBridge::Logger::reportHibernationEvent(
1119 HibernationEvent event) { 1119 HibernationEvent event) {
1120 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, 1120 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram,
1121 ("Canvas.HibernationEvents", HibernationEventCount)); 1121 ("Canvas.HibernationEvents", HibernationEventCount));
1122 hibernationHistogram.count(event); 1122 hibernationHistogram.count(event);
1123 } 1123 }
1124 1124
1125 } // namespace blink 1125 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698