| 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 * 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |