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

Side by Side Diff: sky/engine/platform/graphics/Canvas2DLayerBridge.cpp

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 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
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 namespace blink { 49 namespace blink {
50 50
51 static PassRefPtr<SkSurface> createSkSurface(GrContext* gr, const IntSize& size, int msaaSampleCount = 0) 51 static PassRefPtr<SkSurface> createSkSurface(GrContext* gr, const IntSize& size, int msaaSampleCount = 0)
52 { 52 {
53 if (!gr) 53 if (!gr)
54 return nullptr; 54 return nullptr;
55 gr->resetContext(); 55 gr->resetContext();
56 SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height()); 56 SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height());
57 SkSurfaceProps disableLCDProps(0, kUnknown_SkPixelGeometry); 57 SkSurfaceProps disableLCDProps(0, kUnknown_SkPixelGeometry);
58 return adoptRef(SkSurface::NewRenderTarget(gr, info, msaaSampleCount, &disa bleLCDProps)); 58 return adoptRef(SkSurface::NewRenderTarget(gr, SkSurface::kNo_Budgeted, info , msaaSampleCount, &disableLCDProps));
59 } 59 }
60 60
61 PassRefPtr<Canvas2DLayerBridge> Canvas2DLayerBridge::create(const IntSize& size, OpacityMode opacityMode, int msaaSampleCount) 61 PassRefPtr<Canvas2DLayerBridge> Canvas2DLayerBridge::create(const IntSize& size, OpacityMode opacityMode, int msaaSampleCount)
62 { 62 {
63 TRACE_EVENT_INSTANT0("test_gpu", "Canvas2DLayerBridgeCreation", TRACE_EVENT_ SCOPE_NAME_PROCESS); 63 TRACE_EVENT_INSTANT0("test_gpu", "Canvas2DLayerBridgeCreation", TRACE_EVENT_ SCOPE_NAME_PROCESS);
64 OwnPtr<WebGraphicsContext3DProvider> contextProvider = adoptPtr(Platform::cu rrent()->createSharedOffscreenGraphicsContext3DProvider()); 64 OwnPtr<WebGraphicsContext3DProvider> contextProvider = adoptPtr(Platform::cu rrent()->createSharedOffscreenGraphicsContext3DProvider());
65 if (!contextProvider) 65 if (!contextProvider)
66 return nullptr; 66 return nullptr;
67 RefPtr<SkSurface> surface(createSkSurface(contextProvider->grContext(), size , msaaSampleCount)); 67 RefPtr<SkSurface> surface(createSkSurface(contextProvider->grContext(), size , msaaSampleCount));
68 if (!surface) 68 if (!surface)
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 // This copy constructor should only be used for Vector reallocation 565 // This copy constructor should only be used for Vector reallocation
566 // Assuming 'other' is to be destroyed, we transfer m_image and 566 // Assuming 'other' is to be destroyed, we transfer m_image and
567 // m_parentLayerBridge ownership rather than do a refcount dance. 567 // m_parentLayerBridge ownership rather than do a refcount dance.
568 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); 568 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox));
569 m_image = const_cast<MailboxInfo*>(&other)->m_image.release(); 569 m_image = const_cast<MailboxInfo*>(&other)->m_image.release();
570 m_parentLayerBridge = const_cast<MailboxInfo*>(&other)->m_parentLayerBridge. release(); 570 m_parentLayerBridge = const_cast<MailboxInfo*>(&other)->m_parentLayerBridge. release();
571 m_status = other.m_status; 571 m_status = other.m_status;
572 } 572 }
573 573
574 } // namespace blink 574 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/platform/fonts/skia/FontCacheSkia.cpp ('k') | testing/buildbot/chromium.chromiumos.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698