mobile/android/base/gfx/VirtualLayer.java

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
     2  * This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 package org.mozilla.gecko.gfx;
     8 public class VirtualLayer extends Layer {
     9     public VirtualLayer(IntSize size) {
    10         super(size);
    11     }
    13     @Override
    14     public void draw(RenderContext context) {
    15         // No-op.
    16     }
    18     void setPositionAndResolution(int left, int top, int right, int bottom, float newResolution) {
    19         // This is an optimized version of the following code:
    20         // beginTransaction();
    21         // try {
    22         //     setPosition(new Rect(left, top, right, bottom));
    23         //     setResolution(newResolution);
    24         //     performUpdates(null);
    25         // } finally {
    26         //     endTransaction();
    27         // }
    29         // it is safe to drop the transaction lock in this instance (i.e. for the
    30         // VirtualLayer that is just a shadow of what gecko is painting) because
    31         // the position and resolution of this layer are always touched on the compositor
    32         // thread, and therefore do not require synchronization.
    33         mPosition.set(left, top, right, bottom);
    34         mResolution = newResolution;
    35     }
    36 }

mercurial