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

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

Issue 166093005: Clear m_lastImageId for software compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: test Created 6 years, 10 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
« no previous file with comments | « no previous file | Source/web/tests/Canvas2DLayerBridgeTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 } 336 }
337 if (!m_surfaceIsValid) 337 if (!m_surfaceIsValid)
338 setRateLimitingEnabled(false); 338 setRateLimitingEnabled(false);
339 return m_surfaceIsValid; 339 return m_surfaceIsValid;
340 } 340 }
341 341
342 bool Canvas2DLayerBridge::prepareMailbox(blink::WebExternalTextureMailbox* outMa ilbox, blink::WebExternalBitmap* bitmap) 342 bool Canvas2DLayerBridge::prepareMailbox(blink::WebExternalTextureMailbox* outMa ilbox, blink::WebExternalBitmap* bitmap)
343 { 343 {
344 if (bitmap) { 344 if (bitmap) {
345 // Using accelerated 2d canvas with software renderer, which 345 // Using accelerated 2d canvas with software renderer, which
346 // should only happen in tests that use fake graphics contexts. 346 // should only happen in tests that use fake graphics contexts
347 // In this case, we do not care about producing any results for 347 // or in Android WebView in software mode. In this case, we do
348 // compositing. 348 // not care about producing any results for this canvas.
349 m_canvas->silentFlush(); 349 m_canvas->silentFlush();
350 m_lastImageId = 0;
350 return false; 351 return false;
351 } 352 }
352 if (!isValid()) 353 if (!isValid())
353 return false; 354 return false;
354 355
355 blink::WebGraphicsContext3D* webContext = context(); 356 blink::WebGraphicsContext3D* webContext = context();
356 357
357 // Release to skia textures that were previouosly released by the 358 // Release to skia textures that were previouosly released by the
358 // compositor. We do this before acquiring the next snapshot in 359 // compositor. We do this before acquiring the next snapshot in
359 // order to cap maximum gpu memory consumption. 360 // order to cap maximum gpu memory consumption.
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) { 490 Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) {
490 // This copy constructor should only be used for Vector reallocation 491 // This copy constructor should only be used for Vector reallocation
491 // Assuming 'other' is to be destroyed, we transfer m_image ownership 492 // Assuming 'other' is to be destroyed, we transfer m_image ownership
492 // rather than do a refcount dance. 493 // rather than do a refcount dance.
493 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); 494 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox));
494 m_image = const_cast<MailboxInfo*>(&other)->m_image.release(); 495 m_image = const_cast<MailboxInfo*>(&other)->m_image.release();
495 m_status = other.m_status; 496 m_status = other.m_status;
496 } 497 }
497 498
498 } 499 }
OLDNEW
« no previous file with comments | « no previous file | Source/web/tests/Canvas2DLayerBridgeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698