| OLD | NEW |
| 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 13 matching lines...) Expand all Loading... |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 | 27 |
| 28 #include "core/platform/graphics/chromium/Canvas2DLayerBridge.h" | 28 #include "core/platform/graphics/chromium/Canvas2DLayerBridge.h" |
| 29 | 29 |
| 30 #include "GrContext.h" | 30 #include "GrContext.h" |
| 31 #include "SkDevice.h" | 31 #include "SkDevice.h" |
| 32 #include "SkSurface.h" | 32 #include "SkSurface.h" |
| 33 #include "core/platform/chromium/TraceEvent.h" | 33 #include "core/platform/chromium/TraceEvent.h" |
| 34 #include "core/platform/chromium/support/GraphicsContext3DPrivate.h" | |
| 35 #include "core/platform/graphics/GraphicsContext3D.h" | 34 #include "core/platform/graphics/GraphicsContext3D.h" |
| 36 #include "core/platform/graphics/chromium/Canvas2DLayerManager.h" | 35 #include "core/platform/graphics/chromium/Canvas2DLayerManager.h" |
| 37 #include "core/platform/graphics/chromium/GraphicsLayerChromium.h" | 36 #include "core/platform/graphics/chromium/GraphicsLayerChromium.h" |
| 38 #include <public/Platform.h> | 37 #include <public/Platform.h> |
| 39 #include <public/WebCompositorSupport.h> | 38 #include <public/WebCompositorSupport.h> |
| 40 #include <public/WebGraphicsContext3D.h> | 39 #include <public/WebGraphicsContext3D.h> |
| 41 | 40 |
| 42 using WebKit::WebExternalTextureLayer; | 41 using WebKit::WebExternalTextureLayer; |
| 43 using WebKit::WebGraphicsContext3D; | 42 using WebKit::WebGraphicsContext3D; |
| 44 using WebKit::WebTextureUpdater; | 43 using WebKit::WebTextureUpdater; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 GrTexture* texture = renderTarget->asTexture(); | 159 GrTexture* texture = renderTarget->asTexture(); |
| 161 texture->invalidateCachedState(); | 160 texture->invalidateCachedState(); |
| 162 return texture->getTextureHandle(); | 161 return texture->getTextureHandle(); |
| 163 } | 162 } |
| 164 return 0; | 163 return 0; |
| 165 #endif // !ENABLE(CANVAS_USES_MAILBOX) | 164 #endif // !ENABLE(CANVAS_USES_MAILBOX) |
| 166 } | 165 } |
| 167 | 166 |
| 168 WebGraphicsContext3D* Canvas2DLayerBridge::context() | 167 WebGraphicsContext3D* Canvas2DLayerBridge::context() |
| 169 { | 168 { |
| 170 return GraphicsContext3DPrivate::extractWebGraphicsContext3D(m_context.get()
); | 169 return GraphicsContext3D::extractWebGraphicsContext3D(m_context.get()); |
| 171 } | 170 } |
| 172 | 171 |
| 173 bool Canvas2DLayerBridge::prepareMailbox(WebKit::WebExternalTextureMailbox* outM
ailbox) | 172 bool Canvas2DLayerBridge::prepareMailbox(WebKit::WebExternalTextureMailbox* outM
ailbox) |
| 174 { | 173 { |
| 175 #if ENABLE(CANVAS_USES_MAILBOX) | 174 #if ENABLE(CANVAS_USES_MAILBOX) |
| 176 // Release to skia textures that were previouosly released by the | 175 // Release to skia textures that were previouosly released by the |
| 177 // compositor. We do this before acquiring the next snapshot in | 176 // compositor. We do this before acquiring the next snapshot in |
| 178 // order to cap maximum gpu memory consumption. | 177 // order to cap maximum gpu memory consumption. |
| 179 m_context->makeContextCurrent(); | 178 m_context->makeContextCurrent(); |
| 180 Vector<MailboxInfo>::iterator mailboxInfo; | 179 Vector<MailboxInfo>::iterator mailboxInfo; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 // This copy constructor should only be used for Vector reallocation | 290 // This copy constructor should only be used for Vector reallocation |
| 292 // Assuming 'other' is to be destroyed, we swap m_image ownership | 291 // Assuming 'other' is to be destroyed, we swap m_image ownership |
| 293 // rather than do a refcount dance. | 292 // rather than do a refcount dance. |
| 294 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); | 293 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); |
| 295 m_image.swap(const_cast<SkAutoTUnref<SkImage>*>(&other.m_image)); | 294 m_image.swap(const_cast<SkAutoTUnref<SkImage>*>(&other.m_image)); |
| 296 m_status = other.m_status; | 295 m_status = other.m_status; |
| 297 } | 296 } |
| 298 #endif | 297 #endif |
| 299 | 298 |
| 300 } | 299 } |
| OLD | NEW |