1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CC_RESOURCES_RESOURCE_UPDATE_H_
6 #define CC_RESOURCES_RESOURCE_UPDATE_H_
8 #include "base/memory/ref_counted.h"
9 #include "cc/base/cc_export.h"
10 #include "skia/ext/refptr.h"
11 #include "ui/gfx/rect.h"
12 #include "ui/gfx/vector2d.h"
19 class PrioritizedResource;
21 struct CC_EXPORT ResourceUpdate {
22 static ResourceUpdate Create(PrioritizedResource* resource,
23 const SkBitmap* bitmap,
24 gfx::Rect content_rect,
25 gfx::Rect source_rect,
26 gfx::Vector2d dest_offset);
27 static ResourceUpdate CreateFromCanvas(PrioritizedResource* resource,
28 const skia::RefPtr<SkCanvas>& canvas,
29 gfx::Rect content_rect,
30 gfx::Rect source_rect,
31 gfx::Vector2d dest_offset);
34 virtual ~ResourceUpdate();
36 PrioritizedResource* texture;
37 const SkBitmap* bitmap;
38 skia::RefPtr<SkCanvas> canvas;
39 gfx::Rect content_rect;
40 gfx::Rect source_rect;
41 gfx::Vector2d dest_offset;
46 #endif // CC_RESOURCES_RESOURCE_UPDATE_H_