summaryrefslogtreecommitdiffstats
path: root/ui/gfx/compositor/test_texture.cc
blob: ce1b9f48a731b55207d808c09b494c117a93df83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/gfx/compositor/test_texture.h"

#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkDevice.h"

namespace ui {

// static
int TestTexture::live_count_ = 0;

TestTexture::TestTexture() {
  live_count_++;
}

TestTexture::~TestTexture() {
  live_count_--;
}

void TestTexture::SetCanvas(const SkCanvas& canvas,
                            const gfx::Point& origin,
                            const gfx::Size& overall_size) {
  const SkBitmap& bitmap = canvas.getDevice()->accessBitmap(false);
  bounds_of_last_paint_.SetRect(
      origin.x(), origin.y(), bitmap.width(), bitmap.height());
}

void TestTexture::Draw(const ui::TextureDrawParams& params,
                       const gfx::Rect& clip_bounds) {
}

}  // namespace ui