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

Side by Side Diff: Source/core/platform/graphics/chromium/Canvas2DLayerManagerTest.cpp

Issue 22929012: Change Canvas2DLayerBridge to stay alive until last mailbox is returned. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 class FakeCanvas2DLayerBridge : public Canvas2DLayerBridge { 45 class FakeCanvas2DLayerBridge : public Canvas2DLayerBridge {
46 public: 46 public:
47 FakeCanvas2DLayerBridge(PassRefPtr<GraphicsContext3D> context, SkDeferredCan vas* canvas) 47 FakeCanvas2DLayerBridge(PassRefPtr<GraphicsContext3D> context, SkDeferredCan vas* canvas)
48 : Canvas2DLayerBridge(context, canvas, NonOpaque) 48 : Canvas2DLayerBridge(context, canvas, NonOpaque)
49 , m_freeableBytes(0) 49 , m_freeableBytes(0)
50 , m_freeMemoryIfPossibleCount(0) 50 , m_freeMemoryIfPossibleCount(0)
51 , m_flushCount(0) 51 , m_flushCount(0)
52 { 52 {
53 } 53 }
54 54
55 ~FakeCanvas2DLayerBridge()
56 {
57 m_destructionInProgress = true;
58 }
59
55 virtual size_t storageAllocatedForRecording() OVERRIDE 60 virtual size_t storageAllocatedForRecording() OVERRIDE
56 { 61 {
57 // Because the fake layer has no canvas to query, just 62 // Because the fake layer has no canvas to query, just
58 // return status quo. Allocation changes that would normally be 63 // return status quo. Allocation changes that would normally be
59 // initiated by the canvas can be faked by invoking 64 // initiated by the canvas can be faked by invoking
60 // storageAllocatedForRecordingChanged directly from the test code. 65 // storageAllocatedForRecordingChanged directly from the test code.
61 return m_bytesAllocated; 66 return m_bytesAllocated;
62 } 67 }
63 68
64 void fakeFreeableBytes(size_t size) 69 void fakeFreeableBytes(size_t size)
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 flushEvictionTest(); 259 flushEvictionTest();
255 } 260 }
256 261
257 TEST_F(Canvas2DLayerManagerTest, testDeferredFrame) 262 TEST_F(Canvas2DLayerManagerTest, testDeferredFrame)
258 { 263 {
259 deferredFrameTest(); 264 deferredFrameTest();
260 } 265 }
261 266
262 } // namespace 267 } // namespace
263 268
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698